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

运行上面的命令给我以下消息..

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

我知道路径设置有问题..我也检查了这篇文章

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

这是我当前的路径设置..有什么帮助吗?

4

3 回答 3

3

Go Tour 项目最近更新了。

Go week.2011-11-09版本将json包重命名为encoding/json.

Go week.2011-12-14go-tour版本将包import路径的命名从 更改"go-tour.googlecode.com/hg/tree""code.google.com/p/go-tour/tree".

更新到 Go 每周版本(跟上版本)。

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

然后安装go-tour/tree软件包。

$ 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
$ 
于 2011-12-20T21:31:57.013 回答
2

特别是在每周 2011 年 12 月 14 日,goinstall 被更新为拒绝不遵循以下格式的谷歌路径:“code.google.com/p/go-tour/tree”

这种格式会失败:“go-tour.googlecode.com/hg/tree”

实际发布信息:http: //goo.gl/PeXnO

于 2011-12-20T17:31:38.220 回答
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
$ 
于 2011-12-20T16:27:56.497 回答