Can I have multiple GOPATH directories?

Yes, GOPATH is a list of directories (like PATH). Run go help gopath for details. For example, on Linux, I have:

$ go env
GOROOT="/home/peter/go"
GOPATH="/home/peter/gopath:/home/peter/public/gopath"
$

I have something similar on Windows.

Note: Linux uses : as the GOPATH list separator; Windows uses ; as the separator.

If you use go get it will default to the first directory in the list.

Run go env to check that everything is correct.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)