exec format error when running AWS Golang Lambda
You have to build with GOARCH=amd64 GOOS=linux
.
Wherever you build your binary, the binary for Lambda is run on Amazon Linux.
So , try this build command.
GOARCH=amd64 GOOS=linux go build handler.go
The issue is that main() function is not declared in main
package, which is mandatory by Golang language spec