From e0331de8996d1c9f47baf9a58b1f2e00e0a8b4f5 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Sat, 27 Jul 2024 22:36:10 +0200 Subject: [PATCH] Update go/tools/builders/nogo.go Co-authored-by: Zhongpeng Lin --- go/tools/builders/nogo.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/go/tools/builders/nogo.go b/go/tools/builders/nogo.go index 604569caf..ebf5b5d3c 100644 --- a/go/tools/builders/nogo.go +++ b/go/tools/builders/nogo.go @@ -137,8 +137,11 @@ func runNogo(workDir string, nogoPath string, srcs []string, facts []archive, pa return fmt.Errorf("error creating nogo log file: %v", err) } defer outLog.Close() - if err := cmd.Run(); err != nil { - if exitErr, ok := err.(*exec.ExitError); ok { + err := cmd.Run() + if err == nil { + return nil + } + if exitErr, ok := err.(*exec.ExitError); ok { if !exitErr.Exited() { cmdLine := strings.Join(args, " ") return fmt.Errorf("nogo command '%s' exited unexpectedly: %s", cmdLine, exitErr.String())