diff --git a/.golangci.yml b/.golangci.yml index 83126ae5b41e..edcb58f2a683 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -24,6 +24,7 @@ linters: - whitespace - nosprintfhostport - loggercheck + - makezero run: skip-files: diff --git a/api/common/v1alpha1/ref.go b/api/common/v1alpha1/ref.go index a838fca55cb3..9da14c412650 100644 --- a/api/common/v1alpha1/ref.go +++ b/api/common/v1alpha1/ref.go @@ -99,7 +99,7 @@ type BackendRefHash string func (in BackendRef) Hash() BackendRefHash { keys := maps.Keys(in.Tags) sort.Strings(keys) - orderedTags := make([]string, len(keys)) + orderedTags := make([]string, 0, len(keys)) for _, k := range keys { orderedTags = append(orderedTags, fmt.Sprintf("%s=%s", k, in.Tags[k])) } diff --git a/app/kumactl/cmd/install/install_observability.go b/app/kumactl/cmd/install/install_observability.go index f7db0906b0d2..537636665469 100644 --- a/app/kumactl/cmd/install/install_observability.go +++ b/app/kumactl/cmd/install/install_observability.go @@ -39,7 +39,7 @@ func newInstallObservability(pctx *kumactl_cmd.RootContext) *cobra.Command { if err != nil { return err } - combinedResources := make([]data.File, len(metrics)+len(logging)+len(tracing)) + combinedResources := make([]data.File, 0, len(metrics)+len(logging)+len(tracing)) combinedResources = append(combinedResources, metrics...) combinedResources = append(combinedResources, logging...) combinedResources = append(combinedResources, tracing...)