Skip to content

Commit 896fb87

Browse files
committed
Go: Fix err being shadowed in RunListWithEnv
1 parent 724d026 commit 896fb87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

go/extractor/toolchain/toolchain.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ func RunListWithEnv(format string, patterns []string, additionalEnv []string, fl
194194
out, err := cmd.Output()
195195

196196
if err != nil {
197-
if err, ok := err.(*exec.ExitError); ok {
198-
log.Printf("Warning: go list command failed, output below:\nstdout:\n%s\nstderr:\n%s\n", out, err.Stderr)
197+
if exitErr, ok := err.(*exec.ExitError); ok {
198+
log.Printf("Warning: go list command failed, output below:\nstdout:\n%s\nstderr:\n%s\n", out, exitErr.Stderr)
199199
} else {
200200
log.Printf("Warning: Failed to run go list: %s", err.Error())
201201
}

0 commit comments

Comments
 (0)