apex / apex-go

Golang runtime for Apex/Lambda.
MIT License
293 stars 32 forks source link

'GOOS' is not recognized as an internal or external command, operable program or batch file #66

Closed ahanoff closed 3 years ago

ahanoff commented 6 years ago

I build go function as described here http://www.starkandwayne.com/blog/quick-guide-to-deploying-golang-to-aws-lambda-using-apex/

But when I try to build function, I am getting the following error output:

   • loading functions in functions
   • open                      env= function=hello
   • inferring runtime         env= function=hello
   • inferred runtime          env= function=hello runtime=golang
   • creating build            env= function=hello
   • hook                      command=GOOS=linux GOARCH=amd64 go build -o main *.go env= function=hello hook=build
   ⨯ Error: build hook: 'GOOS' is not recognized as an internal or external command,
operable program or batch file.

Dev environment: OS: win10 Go: go1.9 windows/amd64 Apex: version 0.16.0

I'm wondering why GOOS is equal to linux

tj commented 6 years ago

ah that's because it's building the go binary for Linux (Lambda's containers). Maybe setting env vars via foo=bar on Windows doesn't work?

jjzcru commented 6 years ago

Getting the same error Error: function simpleGo: build hook: 'GOOS' is not recognized as an internal or external command, operable program or batch file. The code is the same hello world from https://www.compose.com/articles/go-serverless-with-apex-and-composes-mongodb/

sujin-sreekumaran commented 2 years ago

In windows you can just run "go build" for help just use - go env