lint: bare-return

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
pull/13369/head
Brad Davidson 2025-12-15 22:45:08 +00:00 committed by Brad Davidson
parent 850de3d04d
commit 55f8d9f731
5 changed files with 10 additions and 10 deletions

View File

@ -343,7 +343,7 @@ func splitCertKeyPEM(bytes []byte) (certPem []byte, keyPem []byte) {
}
}
return
return certPem, keyPem
}
// getKubeletClientCert fills the kubelet client certificate with content returned

View File

@ -82,11 +82,11 @@ func CheckCgroups() (kubeletRoot, runtimeRoot string, controllers map[string]boo
if cgroupsModeV2 {
m, err := cgroupsv2.NewManager("/sys/fs/cgroup", "/", &cgroupsv2.Resources{})
if err != nil {
return
return kubeletRoot, runtimeRoot, controllers
}
enabledControllers, err := m.Controllers()
if err != nil {
return
return kubeletRoot, runtimeRoot, controllers
}
// Intentionally using an expressionless switch to match the logic below
for _, controller := range enabledControllers {
@ -96,7 +96,7 @@ func CheckCgroups() (kubeletRoot, runtimeRoot string, controllers map[string]boo
f, err := os.Open("/proc/self/cgroup")
if err != nil {
return
return kubeletRoot, runtimeRoot, controllers
}
defer f.Close()
@ -150,7 +150,7 @@ func CheckCgroups() (kubeletRoot, runtimeRoot string, controllers map[string]boo
// a host PID scenario but we don't support this.
g, err := os.Open("/proc/1/cgroup")
if err != nil {
return
return kubeletRoot, runtimeRoot, controllers
}
defer g.Close()
scan = bufio.NewScanner(g)
@ -174,5 +174,5 @@ func CheckCgroups() (kubeletRoot, runtimeRoot string, controllers map[string]boo
}
}
}
return
return kubeletRoot, runtimeRoot, controllers
}

View File

@ -7,5 +7,5 @@ func Validate() error {
}
func CheckCgroups() (kubeletRoot, runtimeRoot string, controllers map[string]bool) {
return
return kubeletRoot, runtimeRoot, controllers
}

View File

@ -237,7 +237,7 @@ func dotDFiles(basefile string) (result []string, _ error) {
}
result = append(result, filepath.Join(basefile+".d", file.Name()))
}
return
return result, nil
}
// readConfigFile returns a flattened arg list generated from the specified config
@ -312,7 +312,7 @@ func readConfigFile(file string) (result []string, _ error) {
}
}
return
return result, nil
}
func toSlice(v any) []any {

View File

@ -297,5 +297,5 @@ func (crw *connReadWriteCloser) Write(b []byte) (n int, err error) {
func (crw *connReadWriteCloser) Close() (err error) {
crw.once.Do(func() { err = crw.conn.Close() })
return
return err
}