1
0
mirror of https://github.com/ko-build/ko.git synced 2024-11-30 08:27:02 +02:00

include go build output in build error (#1127)

Signed-off-by: Jason Hall <jason@chainguard.dev>
This commit is contained in:
Jason Hall 2023-09-07 09:45:32 -04:00 committed by GitHub
parent 29d66fdd61
commit daab1ac9dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -312,8 +312,7 @@ func build(ctx context.Context, ip string, dir string, platform v1.Platform, con
if os.Getenv("KOCACHE") == "" {
os.RemoveAll(tmpDir)
}
log.Printf("Unexpected error running \"go build\": %v\n%v", err, output.String())
return "", fmt.Errorf("go build: %w", err)
return "", fmt.Errorf("go build: %w: %s", err, output.String())
}
return file, nil
}