Installation Go (Golang) A little problem of Path.

1,785 views
Skip to first unread message

matthew...@gmail.com

unread,
Apr 18, 2016, 11:05:08 AM4/18/16
to golang-nuts
Hello guys , i'm following this tutorial : https://golang.org/doc/install?download=go1.6.1.windows-amd64.msi  i'm on Windows.
I done all instruction  to "go install github.com/user/hello" , i have set up my "environnement path".I don't understand why the CMD return to me this :

"go: GOPATH entry is relative; must be absolute path: "%HOME%\\work".

Run 'go help gopath' for usage ."

I wrote GOPATH %HOME%\work
             PATH C:\Go\bin
On the environnement variables.
I wrote a directory to : C:\%HOME%\work\src\github.com\user\hello and the file named hello.go with good instruction.
I wrote C:\Go\%HOME%\work\src\github.com\user\hello and the file named hello.go with good instruction.
i wrote C:\Go\src\%HOME%\work\src\github.com\user\hello  and the file named hello.go with good instruction.
Cause i didn't know where to put this.

I think i followed well the instruction but i may miss something .. So can you explain te me what happen ?
I tanks you a lot (I'm french so maybe a none comprehension of something ? :O)

Could you explain me how obtains my exectuable ? Thx !!!! =) Guys !!

Shawn Milochik

unread,
Apr 18, 2016, 11:32:54 AM4/18/16
to golang-nuts
On Mon, Apr 18, 2016 at 5:26 AM, <matthew...@gmail.com> wrote:

"go: GOPATH entry is relative; must be absolute path: "%HOME%\\work".



This error tells you everything you need to know. If your name is matthew and your home folder is /home/matthew, you must use /home/matthew, instead of $HOME.

In your case, this means using something like c:\users\matthew\work instead of %HOME%\\work.


Manlio Perillo

unread,
Apr 18, 2016, 11:53:33 AM4/18/16
to golang-nuts, matthew...@gmail.com
Il giorno lunedì 18 aprile 2016 17:05:08 UTC+2, matthew...@gmail.com ha scritto:
Hello guys , i'm following this tutorial : https://golang.org/doc/install?download=go1.6.1.windows-amd64.msi  i'm on Windows.
I done all instruction  to "go install github.com/user/hello" , i have set up my "environnement path".I don't understand why the CMD return to me this :

"go: GOPATH entry is relative; must be absolute path: "%HOME%\\work".


> [...]

You must not use %HOME% on Windows, for GOPATH.

The install documentation should probably be improved, with well distinct sections for UNIX systems and Windows.
I found GOPATH one of the most confusing thing of Go for a newbie (including myself when I start learning Go).


Manlio
Reply all
Reply to author
Forward
0 new messages