Debian Codegraph @

go/analysis/passes/modernize/testdata/src/waitgroupgo/waitgroup_dot.go

raw
1 package waitgroup
2
3 import (
4 "fmt"
5 . "sync"
6 )
7
8 // supported case for pattern 1.
9 func _() {
10 var wg WaitGroup
11 wg.Add(1)
12 go func() { // want "Goroutine creation can be simplified using WaitGroup.Go"
13 defer wg.Done()
14 fmt.Println()
15 }()
16
17 wg.Add(1)
18 go func() { // want "Goroutine creation can be simplified using WaitGroup.Go"
19 fmt.Println()
20 wg.Done()
21 }()
22 }