Skip to content

Commit 8f4513a

Browse files
author
Christian Rebischke
committedJul 12, 2022
fix: gosec warnings
This commit fixes all gosec warnings either via ignoring the error, where it makes sense or via fixing it. I have fixed multiple implicit memory aliasing errors in loops. These can be dangerous. For more information: https://stackoverflow.com/questions/62446118/implicit-memory-aliasing-in-for-loop Fixes: OSD-11463
1 parent 7ef4b84 commit 8f4513a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+338
-103
lines changed
 

‎.golangci.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
run:
2+
# Our CI expects a vendor directory, hence we have to use -mod=readonly here as well.
3+
modules-download-mode: readonly
4+
5+
issues:
6+
# on default, golangci-lint excludes gosec. Hence, we have to
7+
# explicitly disable the exclude-use-default: https://github.com/golangci/golangci-lint/issues/1504
8+
exclude-use-default: false
9+
10+
# individual linter configs go here
11+
linters-settings:
12+
13+
# default linters are enabled `golangci-lint help linters`
14+
linters:
15+
disable-all: true
16+
enable:
17+
- gosec

‎cmd/aao/cmd.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package aao
22

33
import (
4+
"fmt"
45
"github.com/spf13/cobra"
56
"k8s.io/cli-runtime/pkg/genericclioptions"
67
)
@@ -20,5 +21,8 @@ func NewCmdAao(streams genericclioptions.IOStreams, flags *genericclioptions.Con
2021
}
2122

2223
func help(cmd *cobra.Command, _ []string) {
23-
cmd.Help()
24+
err := cmd.Help()
25+
if err != nil {
26+
fmt.Println("Error while calling cmd.Help()", err.Error())
27+
}
2428
}

0 commit comments

Comments
 (0)
Please sign in to comment.