Open distinctdan opened 3 months ago
@distinctdan thanks for raising the issue. I could re-produce your issue. It seems to me that Lambda Builders does not check the status code when building the go package but instead just checks for the existence of the output binary. This is a bug we should fix.
I solved this by upgrading my Go version from1.22.4
to 1.23.2
Wow I spent so long trying to fix this, only for it to be a bug
Description:
When my Go code has a syntax error, I expect
sam build
to display the error. Instead, it's showing a generic error:In my template.yaml, here's the relevant block for my Go lambda:
I have a file
myproject/bootstrap.go
that containsfunc main() { lambda.Start(handler) }
.Steps to reproduce:
Create any syntax error, like renaming a function from
MyFunc
toMyFunc2
Observed result:
A "directory not found" error.
Expected result:
The output from
go build
which shows the actual error.Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: SAM CLI, version 1.121.0