I've been having a hard time trying to execute a simple golang program in a virtual machine powered by vagrant.
These are the relevant fields of my go env
:
GOARCH="amd64"
GOPATH="/usr/local/src/go"
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
This is the program I'm trying to execute ( located in /usr/local/src/go/program ):
package program
import (
"fmt"
)
func main() {
fmt.Print("Aloha")
}
This, the output that I get:
main.go:4:5:
/usr/local/go/src/fmt/doc.go:1:1: expected 'package', found 'EOF'
package runtime:
/usr/local/go/src/runtime/alg.go:1:1: expected 'package', found 'EOF'
Take into account that this is a completely fake program. The weird thing is that it totally works in a different environment. What am I missing here?
Thanks a lot!
package main
? – VonCpackage main
would be more appropriate. That's how it used to be and was failing with the exact same error. Sure, the file was saved ;) – ThisIsEricoEOF
... The files are indeed empty. Thego get
execution seems to be failing at some point. – ThisIsErico