From 16201c41dc69d4d7896e85653580dee35382fd23 Mon Sep 17 00:00:00 2001 From: Ron Evans Date: Tue, 18 Jun 2019 13:36:48 +0200 Subject: [PATCH] test: replace ExitStatus() with go1.11 compatible syntax Signed-off-by: Ron Evans --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 97ea47d3..09310abb 100644 --- a/main.go +++ b/main.go @@ -367,7 +367,10 @@ func Test(pkgName, target string, config *BuildConfig) error { if err != nil { // Propagate the exit code if err, ok := err.(*exec.ExitError); ok { - os.Exit(err.ExitCode()) + if status, ok := err.Sys().(syscall.WaitStatus); ok { + os.Exit(status.ExitStatus()) + } + os.Exit(1) } return &commandError{"failed to run compiled binary", tmppath, err} }