Removed any mention of setting GOROOT as it is not necessary. It is automatically set to the right value depending on the installation method.
thanks, aditi > On Oct 25, 2015, at 7:25 PM, todd mitton <[email protected]> wrote: > > I don't think you should be setting GOROOT. GOROOT is baked into the > binary when it's compiled. The value baked in will be different depending > on the installation method you used. You only need to set GOROOT if you > move things around after installation. > > Unset the GOROOT env variable and run 'go env'. If the value for GOROOT > returned by 'go env' looks good, then don't override it and you should be > fine. > > -Todd > > On Sat, Oct 24, 2015 at 6:46 PM, Sterling Hughes <[email protected]> > wrote: > >> Hi Justin, >> >> On Sat, Oct 24, 2015 at 6:12 PM, Justin Mclean <[email protected]> >> wrote: >>> Hi, >>> >>> I followed the steps here[1] but have run into an issue when running "go >> get github.com/tools/godep”. >>> >>> package bufio: unrecognized import path "bufio" >>> package bytes: unrecognized import path "bytes" >>> package encoding/json: unrecognized import path "encoding/json" >>> package encoding/xml: unrecognized import path "encoding/xml" >>> package errors: unrecognized import path "errors" >>> …. and lots more …. >>> >>> $echo $GOPATH >>> /Users/justinmclean/dev/go >>> $ echo $GOROOT >>> /usr/local/Cellar/go >>> $ which go >>> /usr/local/bin/go >>> $ ls -l /usr/local/bin/go >>> lrwxr-xr-x 1 justinmclean admin 25 25 Oct 11:25 /usr/local/bin/go -> >> ../Cellar/go/1.4.2/bin/go >>> $go version >>> go version go1.4.2 darwin/amd64 >>> >>> I’m running on OS X Yosemite. >>> >> >> That's odd. I'm running the exact same version of go, and don't have >> this problem. Only difference is my $GOROOT, perhaps try setting that >> to the same as mine? >> >> For reference: >> >> $ echo $GOROOT >> /usr/local/Cellar/go/1.4.2/libexec >> $ echo $GOPATH >> /Users/sterling/dev/go/ >> $ which go >> /usr/local/bin/go >> $ ls -l /usr/local/bin/go >> lrwxr-xr-x 1 sterling admin 25 May 28 14:03 /usr/local/bin/go -> >> ../Cellar/go/1.4.2/bin/go >> $ go version >> go version go1.4.2 darwin/amd64 >> >> >>> A look at stack overflow/google shows a few people with similar issues >> and it seem the answer was to unset GOROOT. so it looks like GOROOT should >> not be set in the first place? Anyone more familiar with go can explain why >> that was required? >>> >> >> I'll poke at this. Can you try setting GOROOT as mentioned above, and >> let me know if that works? >> >>> There also a couple of minor issues with the setting instructions for >> instance this: >>> go run %GOPATH%/src/github.com/mynewt/newt/newt.go >>> Should be this I think: >>> go run $GOPATH/src/github.com/mynewt/newt/newt.go >>> >> >> Yep. >>
