3
goinstall go-tour.googlecode.com/hg/gotour

Running the above command give me the following message ..

goinstall: encoding/json: go/build: package could not be found locally
goinstall: code.google.com/p/go-tour/pic: cannot download: code.google.com/p/go-tour/pic
goinstall: code.google.com/p/go-tour/tree: cannot download: code.google.com/p/go-tour/tree
goinstall: code.google.com/p/go-tour/wc: cannot download: code.google.com/p/go-tour/wc
goinstall: os/exec: go/build: package could not be found locally
goinstall: net/http: go/build: package could not be found locally

I know that there is problem with path setting .. i also checked this post

export PATH=$PATH:/home/sakthi/sakthig/code/my/go/go/bin
export GOROOT=/home/sakthi/sakthig/code/my/go/go
export GOPATH=$GOROOT/bin

This is my current path setting.. any help ?

Community
  • 1
  • 1
sakthig
  • 2,187
  • 3
  • 18
  • 22

3 Answers3

3

The Go Tour project has been updated recently.

The Go weekly.2011-11-09 release renamed the json package to encoding/json.

The Go weekly.2011-12-14 release changed the naming for the go-tour package import paths from "go-tour.googlecode.com/hg/tree" to "code.google.com/p/go-tour/tree".

Update to the Go weekly release (Keeping up with releases).

$ cd $GOROOT/src
$ hg pull
$ hg update weekly
$ ./all.bash

Then install the go-tour/tree package.

$ cd $GOROOT
$ goinstall -v -fix code.google.com/p/go-tour/tree
goinstall: open /home/peter/go/goinstall.log: no such file or directory
goinstall: code.google.com/p/go-tour/tree: download
goinstall: cd / && /usr/bin/hg clone https://code.google.com/p/go-tour /home/peter/go/src/pkg/code.google.com/p/go-tour
goinstall: selecting tip
goinstall: cd /home/peter/go/src/pkg/code.google.com/p/go-tour && /usr/bin/hg update
goinstall: code.google.com/p/go-tour/tree: install
goinstall: cd /home/peter/go/src/pkg/code.google.com/p/go-tour/tree && /bin/bash gomake -f- install
$ 
peterSO
  • 158,998
  • 31
  • 281
  • 276
  • `hg update weekly` This command helped .. before this i used to try `hg update release` which dint work or at least dint solve my problem ;) – sakthig Dec 21 '11 at 05:50
2

Specifically in the weekly.2011-12-14, goinstall was updated to reject google paths that don't follow the format: "code.google.com/p/go-tour/tree"

This format would fail: "go-tour.googlecode.com/hg/tree"

Actual release information: http://goo.gl/PeXnO

jdi
  • 90,542
  • 19
  • 167
  • 203
  • i tried and ended with same error message `go/build: package could not be found locally` – sakthig Dec 20 '11 at 17:48
  • Did ~go/src/all.bash reported any problems? Also check if you're not mixing binaries versions. Look e.g. at/if exists ~/go/bin, ~/bin, ... if there are any Go binaries and check their versions and compare with your PATH. Perhaps try w/o GOPATH set. Try `$(which 6g) -V`. It must be something simple, but I'm out of ideas :-( – zzzz Dec 20 '11 at 18:15
  • @Sakti - not sure what the problem is then. I just updated my go to the current weekly and ran `goinstall -v -clean -u -nuke code.google.com/p/go-tour/tree` with no problem – jdi Dec 20 '11 at 18:20
  • @jnml - good question. is it possible he didnt run all.bash after updating the repo? – jdi Dec 20 '11 at 18:21
  • go-tour project **is** compatible with r60. Perhaps consult more steps on golang-nuts, I give up, sorry. – zzzz Dec 20 '11 at 19:15
1
$ goinstall go-tour.googlecode.com/hg/gotour
go-tour.googlecode.com/hg/gotour: download failed: unsupported import path;
should be "code.google.com/p/go-tour/gotour"
Run goinstall with -fix to gofix the code. ($GOPATH is not set)
$ goinstall -dashboard=false code.google.com/p/go-tour/gotour
$ (cd ~/go && hg id)
82fdc445f2ff weekly/weekly.2011-12-14
$ 
zzzz
  • 87,403
  • 16
  • 175
  • 139
  • This is what i get by running above line `$ goinstall -dashboard=false code.google.com/p/go-tour/gotour -fix goinstall: code.google.com/p/go-tour/gotour: cannot download: code.google.com/p/go-tour/gotour goinstall: -fix: go/build: package could not be found locally` – sakthig Dec 20 '11 at 16:36
  • `package not found locally` is constant in all goinstall commands – sakthig Dec 20 '11 at 16:39
  • You're probably running a different version of Go. Additionally, if no other goinstall command succeeds then there's probably also some other problem not related to the version of Go. Can you try to switch to latest weekly and reproduce the OK pass as above? – zzzz Dec 20 '11 at 16:43
  • I installed go merely 4 hours ago.. can u show your path settings ? I suspect that may be the problem ?? – sakthig Dec 20 '11 at 16:46
  • `17:48:58 jnml@shinigami:~$ env | grep GO` `GOBIN=/home/jnml/bin` `GOROOT=/home/jnml/go` `17:48:59 jnml@shinigami:~$` – zzzz Dec 20 '11 at 16:49
  • Never used GOPATH for anything. Actually I don't even know for sure what it is good for ;-) – zzzz Dec 20 '11 at 17:02
  • Setting gopath is for installing to different locations such as when you want to have libs located outside the go source tree – jdi Dec 20 '11 at 18:41