I have a Linux virtual machine where I am trying to compile a simple Go package. The package was uploaded to my user directory using git:
$ git clone [...]/test.go Cloning into 'test.go'... done. $ cd test.go/ $ ls main.go
I installed GOPATH and built:
$ export GOPATH=$PWD; echo $GOPATH /home/vagrant/test.go $ go build $ ls main.go test.go*
So far so good. But now, when I try to build again, it fails:
$ go build can't load package: package .: read /home/vagrant/test.go/test.go: unexpected NUL in input
Deleting the test.go file in front of the building will allow it to be built. But this is inconvenient because tools like github.com/codegangsta/gin that try to rebuild the package will not work.
source share