File tree 3 files changed +17
-21
lines changed
3 files changed +17
-21
lines changed Original file line number Diff line number Diff line change 1
1
module github.com/golang/protobuf
2
2
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 =
5
1
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b h1:lohp5blsw53GBXtLyLNaTXPXS9pJ1tiTw61ZHUoE9Qw =
6
2
google.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 (
38
38
"reflect"
39
39
"sort"
40
40
"strings"
41
+ "sync"
41
42
"testing"
42
43
43
44
"github.com/golang/protobuf/proto"
44
45
pb "github.com/golang/protobuf/proto/test_proto"
45
- "golang.org/x/sync/errgroup"
46
46
)
47
47
48
48
func TestGetExtensionsWithMissingExtensions (t * testing.T ) {
@@ -671,18 +671,22 @@ func TestMarshalRace(t *testing.T) {
671
671
// GetExtension will decode it lazily. Make sure this does
672
672
// not race against Marshal.
673
673
674
- var g errgroup.Group
674
+ wg := sync.WaitGroup {}
675
+ errs := make (chan error , 3 )
675
676
for n := 3 ; n > 0 ; n -- {
676
- g .Go (func () error {
677
+ wg .Add (1 )
678
+ go func () {
679
+ defer wg .Done ()
677
680
_ , 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
+ }
687
691
}
688
692
}
You can’t perform that action at this time.
0 commit comments