Go install: "Unable to download package" (even if GOPATH is installed)
I am just getting started with the Go programming language and install Go using the Windows Installer from the website. I tested the installation with help go run hello.go
and it works. The problem comes when I try to create my first program:
$ echo $GOROOT
C:\Go\
$ echo $GOPATH
/cygdrive/c/Users/Paul/Documents/Home/go
mkdir -p $GOPATH/src/hello
Inside this directory, I have a simple program hello.go
:
package main
import "fmt"
func main() {
fmt.Printf("Hello, world.\n")
}
The problem comes up when I try to build and install:
$ go install hello
can't load package: package hello: cannot find package "hello" in any of:
C:\Go\src\hello (from $GOROOT)
\cygdrive\c\Users\Paul\Documents\Home\go\src\hello (from $GOPATH)
+3
source to share