File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,9 +25,7 @@ func TestSyncerStatusStartOnce(t *testing.T) {
2525 var wg sync.WaitGroup
2626
2727 for range 8 {
28- wg .Add (1 )
29- go func () {
30- defer wg .Done ()
28+ wg .Go (func () {
3129 _ , err := status .startOnce (func () error {
3230 if calls .Add (1 ) == 1 {
3331 close (started )
@@ -36,7 +34,7 @@ func TestSyncerStatusStartOnce(t *testing.T) {
3634 return nil
3735 })
3836 require .NoError (t , err )
39- }( )
37+ })
4038 }
4139
4240 <- started
Original file line number Diff line number Diff line change 1919 // sha256.New() allocates ~213 bytes (216B on 64-bit) per call. Pooling
2020 // eliminates this allocation entirely in the hot path.
2121 sha256Pool = sync.Pool {
22- New : func () interface {} {
22+ New : func () any {
2323 return sha256 .New ()
2424 },
2525 }
Original file line number Diff line number Diff line change @@ -19,37 +19,37 @@ import (
1919// structs in hot serialization paths (marshal → discard → repeat per block).
2020var (
2121 pbHeaderPool = sync.Pool {
22- New : func () interface {} {
22+ New : func () any {
2323 return & pb.Header {}
2424 },
2525 }
2626 pbVersionPool = sync.Pool {
27- New : func () interface {} {
27+ New : func () any {
2828 return & pb.Version {}
2929 },
3030 }
3131 pbDataPool = sync.Pool {
32- New : func () interface {} {
32+ New : func () any {
3333 return & pb.Data {}
3434 },
3535 }
3636 pbMetadataPool = sync.Pool {
37- New : func () interface {} {
37+ New : func () any {
3838 return & pb.Metadata {}
3939 },
4040 }
4141 pbSignerPool = sync.Pool {
42- New : func () interface {} {
42+ New : func () any {
4343 return & pb.Signer {}
4444 },
4545 }
4646 pbSignedHeaderPool = sync.Pool {
47- New : func () interface {} {
47+ New : func () any {
4848 return & pb.SignedHeader {}
4949 },
5050 }
5151 pbStatePool = sync.Pool {
52- New : func () interface {} {
52+ New : func () any {
5353 return & pb.State {}
5454 },
5555 }
You can’t perform that action at this time.
0 commit comments