diff --git a/cmd/genyaml/gen_kubectl_yaml.go b/cmd/genyaml/gen_kubectl_yaml.go index fdd84b6ce9a..376a1c7122f 100644 --- a/cmd/genyaml/gen_kubectl_yaml.go +++ b/cmd/genyaml/gen_kubectl_yaml.go @@ -83,7 +83,7 @@ func forceMultiLine(s string) string { } func genFlagResult(flags *pflag.FlagSet) []cmdOption { - result := make([]cmdOption, 0) + result := []cmdOption{} flags.VisitAll(func(flag *pflag.Flag) { // Todo, when we mark a shorthand is deprecated, but specify an empty message. @@ -131,7 +131,7 @@ func genYaml(command *cobra.Command, parent, docsDir string) { } if len(command.Commands()) > 0 || len(parent) > 0 { - result := make([]string, 0) + result := []string{} if len(parent) > 0 { result = append(result, parent) } diff --git a/plugin/pkg/auth/authenticator/request/x509/x509_test.go b/plugin/pkg/auth/authenticator/request/x509/x509_test.go index 12a8e99e0da..6565bea0bd2 100644 --- a/plugin/pkg/auth/authenticator/request/x509/x509_test.go +++ b/plugin/pkg/auth/authenticator/request/x509/x509_test.go @@ -925,7 +925,7 @@ func getCert(t *testing.T, pemData string) *x509.Certificate { } func getCerts(t *testing.T, pemData ...string) []*x509.Certificate { - certs := make([]*x509.Certificate, 0) + certs := []*x509.Certificate{} for _, pemData := range pemData { certs = append(certs, getCert(t, pemData)) }