I’ve written a very small application in Go, and configured an AWS Linux AMI to host. The application is a very simple web server. I’ve installed Go on the Linux VM by following the instructions in the official documentation to the letter. My application runs as expected when invoked with the “go run main.go
” command.
However, I receive an “Invalid argument” error when I attempt to manually launch the binary file generated as a result of running “go install
”. Instead, if I run “go build
” (which I understand to be essentially the same thing, with a few exceptions) and then invoke the resulting binary, the application launches as expected.
I’m invoking the file from within the $GOPATH/bin/
folder as follows:
./myapp
I’ve also added $GOPATH/bin
to the $PATH
variable.
I have also moved the binary from $GOPATH/bin/
to the src
folder, and successfully run it from there.
The Linux instance is a 64-bit instance, and I have installed the corresponding Go 64-bit installation.