-1

I am using VS code and mac terminal both for Go development. In the VS code, I am able to run all the related build and setup because by Go is pointing to correct version as below:

$go version
go version go1.15.6 darwin/amd64

$which go
/usr/local/go/bin/go

But in Terminal go version and GOROOT is showing something different as below:

$go version 
go1.16 darwin/amd64

$which go
/usr/local/bin/go

How to set correct path in terminal too?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Witty Apps
  • 59
  • 1
  • 1
  • 4
  • 1
    You could update your `$PATH` by making sure that `/usr/local/go/bin` comes *before* `/usr/local/bin`. – mkopriva Mar 01 '21 at 11:08

1 Answers1

0

You need for the correct directory to preceed the default in the PATH environment variable.

export PATH=/usr/local/go/bin:$PATH
Richard Barber
  • 5,257
  • 2
  • 15
  • 26