fix wg init

This commit is contained in:
2025-03-27 13:32:30 +01:00
parent 72ab5a24a0
commit 02813ef0c2

View File

@@ -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)