-
Notifications
You must be signed in to change notification settings - Fork 154
Open
Description
Description:
When my Go code has a syntax error, I expect sam build
to display the error. Instead, it's showing a generic error:
Error: GoModulesBuilder:Build - Builder Failed: stat /Users/my.user/my-project/myproject/bootstrap: directory not found
In my template.yaml, here's the relevant block for my Go lambda:
Resources:
MyFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Metadata:
BuildMethod: go1.x
Properties:
CodeUri: myproject/
Handler: bootstrap
Runtime: provided.al2023
Architectures:
- x86_64
I have a file myproject/bootstrap.go
that contains func main() { lambda.Start(handler) }
.
Steps to reproduce:
Create any syntax error, like renaming a function from MyFunc
to MyFunc2
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)
- OS: OSX Sonoma 14.6.1
sam --version
: SAM CLI, version 1.121.0- AWS region: N/a
{
"version": "1.121.0",
"system": {
"python": "3.8.13",
"os": "macOS-14.6.1-x86_64-i386-64bit"
},
"additional_dependencies": {
"docker_engine": "Not available",
"aws_cdk": "Not available",
"terraform": "Not available"
},
"available_beta_feature_env_vars": [
"SAM_CLI_BETA_FEATURES",
"SAM_CLI_BETA_BUILD_PERFORMANCE",
"SAM_CLI_BETA_TERRAFORM_SUPPORT",
"SAM_CLI_BETA_RUST_CARGO_LAMBDA"
]
}
kwan19961217 and szechyjs