fix wg init
This commit is contained in:
2
main.go
2
main.go
@@ -107,6 +107,7 @@ func main() {
|
||||
wg := new(sync.WaitGroup)
|
||||
|
||||
for _, ip := range strings.Split(*shellyFlag, ",") {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
err := checkShelly(ip)
|
||||
if err != nil {
|
||||
@@ -119,7 +120,6 @@ func main() {
|
||||
}
|
||||
|
||||
func checkShelly(ip string) error {
|
||||
wg.Add(1)
|
||||
defer wg.Done()
|
||||
log.Infof("shelly worker %s started", ip)
|
||||
|
||||
|
Reference in New Issue
Block a user