diff --git a/cmd/neofs-ir/main.go b/cmd/neofs-ir/main.go index c1a262fd11..610f11245f 100644 --- a/cmd/neofs-ir/main.go +++ b/cmd/neofs-ir/main.go @@ -130,15 +130,17 @@ func parsePublicKeysFromString(argument string) (keys.PublicKeys, error) { } func initHTTPServers(cfg *viper.Viper) []*httputil.Server { - var httpServers []*httputil.Server - - for _, item := range []struct { + items := []struct { cfgPrefix string handler func() http.Handler }{ {"profiler", httputil.Handler}, {"metrics", promhttp.Handler}, - } { + } + + httpServers := make([]*httputil.Server, 0, len(items)) + + for _, item := range items { addr := cfg.GetString(item.cfgPrefix + ".address") if addr == "" { continue