fix new linter warnings from prealloc linter

This commit is contained in:
Ryan Richard
2026-02-13 15:19:15 -08:00
parent 745c93af51
commit e5366d782d
20 changed files with 50 additions and 48 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
// Copyright 2021-2024 the Pinniped contributors. All Rights Reserved.
// Copyright 2021-2026 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*
@@ -113,7 +113,7 @@ func decodeObj(r *http.Request) (runtime.Object, error) {
}
var obj runtime.Object
var errs []error //nolint:prealloc
var errs []error
codecsThatWeUseInOurCode := []runtime.NegotiatedSerializer{
kubescheme.Codecs,
aggregatorclientscheme.Codecs,
+4 -3
View File
@@ -1,4 +1,4 @@
// Copyright 2022-2024 the Pinniped contributors. All Rights Reserved.
// Copyright 2022-2026 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package testutil
@@ -36,8 +36,9 @@ const (
// allDynamicClientScopes returns a slice of all scopes that are supported by the Supervisor for dynamic clients.
func allDynamicClientScopes() []supervisorconfigv1alpha1.Scope {
scopes := []supervisorconfigv1alpha1.Scope{}
for _, s := range strings.Split(AllDynamicClientScopesSpaceSep, " ") {
splitOnSpace := strings.Split(AllDynamicClientScopesSpaceSep, " ")
scopes := make([]supervisorconfigv1alpha1.Scope, 0, len(splitOnSpace))
for _, s := range splitOnSpace {
scopes = append(scopes, supervisorconfigv1alpha1.Scope(s))
}
return scopes