-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?

Flimzy
  • 68,325
  • 15
  • 126
  • 165
Witty Apps
  • 39
  • 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
  • 3,625
  • 2
  • 12
  • 24