File tree Expand file tree Collapse file tree 3 files changed +17
-21
lines changed Expand file tree Collapse file tree 3 files changed +17
-21
lines changed Original file line number Diff line number Diff line change 11module github.com/golang/protobuf
22
3- require (
4- golang.org/x/net v0.0.0-20180906233101-161cd47e91fd // indirect
5- golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f
6- google.golang.org/genproto v0.0.0-20180831171423-11092d34479b
7- )
3+ require google.golang.org/genproto v0.0.0-20180831171423-11092d34479b
Original file line number Diff line number Diff line change 1- golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA =
2- golang.org/x/net v0.0.0-20180906233101-161cd47e91fd /go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4 =
3- golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA =
4- golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f /go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM =
51google.golang.org/genproto v0.0.0-20180831171423-11092d34479b h1:lohp5blsw53GBXtLyLNaTXPXS9pJ1tiTw61ZHUoE9Qw =
62google.golang.org/genproto v0.0.0-20180831171423-11092d34479b /go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc =
Original file line number Diff line number Diff line change @@ -38,11 +38,11 @@ import (
3838 "reflect"
3939 "sort"
4040 "strings"
41+ "sync"
4142 "testing"
4243
4344 "github.com/golang/protobuf/proto"
4445 pb "github.com/golang/protobuf/proto/test_proto"
45- "golang.org/x/sync/errgroup"
4646)
4747
4848func TestGetExtensionsWithMissingExtensions (t * testing.T ) {
@@ -671,18 +671,22 @@ func TestMarshalRace(t *testing.T) {
671671 // GetExtension will decode it lazily. Make sure this does
672672 // not race against Marshal.
673673
674- var g errgroup.Group
674+ wg := sync.WaitGroup {}
675+ errs := make (chan error , 3 )
675676 for n := 3 ; n > 0 ; n -- {
676- g .Go (func () error {
677+ wg .Add (1 )
678+ go func () {
679+ defer wg .Done ()
677680 _ , err := proto .Marshal (m )
678- return err
679- })
680- g .Go (func () error {
681- _ , err := proto .GetExtension (m , pb .E_Ext_More )
682- return err
683- })
684- }
685- if err := g .Wait (); err != nil {
686- t .Fatal (err )
681+ errs <- err
682+ }()
683+ }
684+ wg .Wait ()
685+ close (errs )
686+
687+ for err = range errs {
688+ if err != nil {
689+ t .Fatal (err )
690+ }
687691 }
688692}
You can’t perform that action at this time.
0 commit comments