I installed the Go, then added path requirements to my .bash_profile:
.bash_profile
export PATH=$PATH:/usr/local/go/bin
export GOPATH
I had the same problem in Windows 10,
So I set a system variable named GOBIN with absolute value F:\go\bin.
GOBIN
F:\go\bin
Then ran go install main.go and everything worked perfectly fine!
go install main.go