mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Merge pull request #36713 from brendandburns/lint
Automatic merge from submit-queue Fix some lint errors. `golint` for some reason doesn't like `make([]foo, 0)` so switch to explicit instantiation.
This commit is contained in:
commit
c9d0969d25
@ -83,7 +83,7 @@ func forceMultiLine(s string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func genFlagResult(flags *pflag.FlagSet) []cmdOption {
|
func genFlagResult(flags *pflag.FlagSet) []cmdOption {
|
||||||
result := make([]cmdOption, 0)
|
result := []cmdOption{}
|
||||||
|
|
||||||
flags.VisitAll(func(flag *pflag.Flag) {
|
flags.VisitAll(func(flag *pflag.Flag) {
|
||||||
// Todo, when we mark a shorthand is deprecated, but specify an empty message.
|
// 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 {
|
if len(command.Commands()) > 0 || len(parent) > 0 {
|
||||||
result := make([]string, 0)
|
result := []string{}
|
||||||
if len(parent) > 0 {
|
if len(parent) > 0 {
|
||||||
result = append(result, parent)
|
result = append(result, parent)
|
||||||
}
|
}
|
||||||
|
@ -925,7 +925,7 @@ func getCert(t *testing.T, pemData string) *x509.Certificate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getCerts(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 {
|
for _, pemData := range pemData {
|
||||||
certs = append(certs, getCert(t, pemData))
|
certs = append(certs, getCert(t, pemData))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user