I've installed go v1.14.2 in my root, gave it permission and then moved the go folder to another drive
/mnt/d/go
Now in the .profile and .bashrc file I've already exported the GOROOT as well as GOPATH and it looks like this.
export GOROOT=$mnt/d/go
export GOPATH=$mnt/d/go_space
export PATH=$PATH:/mnt/d/go/bin:$GOPATH/bin
On running go version, I'm getting
go: cannot find GOROOT directory: /d/go
It should be:
Because
mnt
is not set as anything,$mnt
will return nothing.Log out and log back in to apply the changes.
You see,
PATH
is an environment variable which is already set. You can run the following command to show what it is set to:There are also other variables, like
HOME
andUSER
too:and you can set your own:
and check it:
and you can also add something like
hello
tofoo
like this:or