diff options
| author | 2026-03-06 13:11:56 +0800 | |
|---|---|---|
| committer | 2026-03-06 13:12:06 +0800 | |
| commit | 195447b77ff5fc37e184d2d0e7aae99aec250d8c (patch) | |
| tree | c683dc459d333e8b8c71689b9d2cd3d9e8649650 /internal/compress | |
| parent | format/pack/ingest: I don't think we need to use a clone there (diff) | |
| signature | No signature | |
*: go fix ./...
Diffstat (limited to 'internal/compress')
| -rw-r--r-- | internal/compress/flate/example_test.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/internal/compress/flate/example_test.go b/internal/compress/flate/example_test.go index d541e0e1..ead6d090 100644 --- a/internal/compress/flate/example_test.go +++ b/internal/compress/flate/example_test.go @@ -166,9 +166,7 @@ func Example_synchronization() { rp, wp := io.Pipe() // Start a goroutine to act as the transmitter. - wg.Add(1) - go func() { - defer wg.Done() + wg.Go(func() { defer wp.Close() zw, err := flate.NewWriter(wp, flate.BestSpeed) @@ -195,12 +193,10 @@ func Example_synchronization() { if err := zw.Close(); err != nil { log.Fatal(err) } - }() + }) // Start a goroutine to act as the receiver. - wg.Add(1) - go func() { - defer wg.Done() + wg.Go(func() { zr := flate.NewReader(rp) @@ -229,7 +225,7 @@ func Example_synchronization() { if err := zr.Close(); err != nil { log.Fatal(err) } - }() + }) // Output: // Received 1 bytes: A |
