Skip to content

Commit 1514289

Browse files
authored
Merge pull request #4658 from kersten/fix/cli-config-plugins-avoid-shadowing-err
🌱 (chore): avoid shadowing of 'err' in CLI options, YAML store, and external plugin helpers
2 parents 0a4f4e3 + c2f2542 commit 1514289

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Diff for: pkg/cli/options.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func getPluginsRoot(host string) (pluginsRoot string, err error) {
203203
// if user provides specific path, return
204204
if pluginsPath := os.Getenv("EXTERNAL_PLUGINS_PATH"); pluginsPath != "" {
205205
// verify if the path actually exists
206-
if _, err := os.Stat(pluginsPath); err != nil {
206+
if _, err = os.Stat(pluginsPath); err != nil {
207207
if os.IsNotExist(err) {
208208
// the path does not exist
209209
return "", fmt.Errorf("the specified path %s does not exist", pluginsPath)

Diff for: pkg/config/store/yaml/store.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func (s *yamlStore) LoadFrom(path string) error {
8989

9090
// Check the file version
9191
var versioned versionedConfig
92-
if err := yaml.Unmarshal(in, &versioned); err != nil {
92+
if err = yaml.Unmarshal(in, &versioned); err != nil {
9393
return store.LoadError{Err: fmt.Errorf("unable to determine config version: %w", err)}
9494
}
9595

Diff for: pkg/plugins/external/helpers.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func getUniverseMap(fs machinery.Filesystem) (map[string]string, error) {
127127
}
128128

129129
defer func() {
130-
if err := file.Close(); err != nil {
130+
if err = file.Close(); err != nil {
131131
return
132132
}
133133
}()

0 commit comments

Comments
 (0)