1

Golang newb here.

enter image description here

Why is VSCode telling me that GOPATH is not set? I restarted VSCode a few times. The env variable is set as you can see from the terminal, and it's set to $HOME/go.

export GOROOT=$HOME/go
export GOPATH=$HOME/go
export GOBIN=$HOME/go/bin
export PATH=$PATH:$GOROOT/bin

I am using the golang plugin from lukehoban: https://code.visualstudio.com/docs/languages/go

And I have this in workspace settings:

{
    "go.gopath": "/Users/alexamil/go"
}

anyone know what might be wrong?

Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
  • 2
    I'm not familiar with VSCode, but in general GOPATH is optional (the default is `$HOME/go`), but `GOROOT=$HOME/go` is incorrect. You should almost never set GOROOT, and it should never be the same as GOPATH. – JimB Apr 09 '18 at 17:47
  • thanks..tbh guys I have never read so much conflicting info about env variables for any language, and that's not your fault. – Alexander Mills Apr 09 '18 at 17:50

0 Answers0