replace & with new()

This commit is contained in:
2026-07-13 13:33:40 +02:00
parent f4fe1aa875
commit 6cae5ddef9
16 changed files with 49 additions and 51 deletions

View File

@@ -101,9 +101,7 @@ func getClusterStatus(conf *cfg.Config) (*apiResponse, error) {
es := conf.DefaultCluster.ES()
responses := make(chan apiResponse, gocount)
wg := &sync.WaitGroup{}
wg.Add(gocount)
wg := new(sync.WaitGroup{})
wg.Go(func() {
getApiData(conf, es, responses, "health")
@@ -135,7 +133,7 @@ func getClusterStatus(conf *cfg.Config) (*apiResponse, error) {
wg.Wait()
all := apiResponse{}
all := new(apiResponse{})
var err error
@@ -162,7 +160,7 @@ func getClusterStatus(conf *cfg.Config) (*apiResponse, error) {
}
}
return &all, err
return all, err
}
func ClusterStatus(conf *cfg.Config) error {