I have GO installed on a Fedora 21 laptop and I setup GOPATH and GOBIN, but it for some reason is not letting me install my go Programs.
pred@computer01 [20:03:02] ~ $ echo $GOPATH /home/pred/Documents/GO pred@computer01 [20:03:11] ~ $ echo $GOBIN /home/pred/Documents/GO/bin pred@computer01 [20:03:15] ~ $ cd $GOPATH pred@computer01 [20:03:21] ~/Documents/GO $ go install src/github.com/pred3/go_helloworld/helloworld/helloworld.go go install: no install location for .go files listed on command line (GOBIN not set) pred@computer01 [20:03:32] ~/Documents/GO $ go env GOARCH="amd64" GOBIN="/home/pred/Documents/GO/bin" GOCHAR="6" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/pred/Documents/GO" GORACE="" GOROOT="/usr/lib/golang" GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64" CC="gcc" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0" CXX="g++" CGO_ENABLED="1"
What else should I be doing to get this to work?
Issuing the following command as stated below also gave errors.
pred@computer1 [21:22:51] ~/Documents/GO $ go install src/github.com/pred3/go_helloworld/helloworld can't load package: package src/github.com/predatorian3/go_helloworld/helloworld: cannot find package "src/github.com/pred3/go_helloworld/helloworld" in any of: /usr/lib/golang/src/src/github.com/pred3/go_helloworld/helloworld (from $GOROOT) /home/pred/Documents/GO/src/src/github.com/pred3/go_helloworld/helloworld (from $GOPATH)
However, I did not have
package main at the beginning of the go file I was trying to install. Once I changed it to
package main it worked. I'm not sure why I couldn't use a different package name though.