Skip to content

Commit

Permalink
Update go/tools/builders/nogo.go
Browse files Browse the repository at this point in the history
Co-authored-by: Zhongpeng Lin <[email protected]>
  • Loading branch information
fmeum and linzhp authored Jul 27, 2024
1 parent e0331de commit 6678250
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions go/tools/builders/nogo.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,12 @@ func runNogo(workDir string, nogoPath string, srcs []string, facts []archive, pa
return fmt.Errorf("nogo command '%s' exited unexpectedly: %s", cmdLine, exitErr.String())
}
prettyOut := relativizePaths(out.Bytes())
if exitErr.ExitCode() == 2 {
// Do not fail the action if nogo has findings so that facts are
// still available for downstream targets.
_, err := outLog.Write(prettyOut)
if exitErr.ExitCode() != 2 {
return errors.New(string(prettyOut))
}
// Do not fail the action if nogo has findings so that facts are
// still available for downstream targets.
_, err := outLog.Write(prettyOut)
if err != nil {
return fmt.Errorf("error writing nogo log file: %v", err)
}
Expand Down

0 comments on commit 6678250

Please sign in to comment.