Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

compile: version "go1.9" does not match go tool version "go1.9.1"

Tags:

go

I am getting this error when I tried to run an example helloworld code I got onlie.

compile: version "go1.9" does not match go tool version "go1.9.1" 

My computer has go1.9.1. What does the error mean and how can I fix this?

like image 347
leopoodle Avatar asked Oct 11 '17 16:10

leopoodle


1 Answers

If you are installing using OSX homebrew you may need to set the $GOROOT in your .bashrc, .zshrc, etc:

export GOROOT=/usr/local/opt/go/libexec 

I had the same error this morning when I updated from 1.9 -> 1.9.1 though according to several post the $GOROOT shouldn't have to be set and I had not set it until today. This may be a bug?

Edit: not a bug, for more details see answer below.

like image 78
ksrb Avatar answered Sep 20 '22 20:09

ksrb