英文:
Golang - Issues go get-ting basic commands "vet" and "godoc"
问题
我刚刚在OSX Mavericks上安装了Homebrew Go 1.2.2。一切似乎都运行正常,除了当我尝试运行以下命令之一时:
$ go get code.google.com/p/go.tools/cmd/godoc
$ go get code.google.com/p/go.tools/cmd/vet
我得到了这个堆栈跟踪:
/Users/sozorogami/go/src/code.google.com/p/go.tools/go/exact/exact.go:255: new(big.Rat).SetFrac(x.val, int1).Float32 undefined (type *big.Rat has no field or method Float32)
/Users/sozorogami/go/src/code.google.com/p/go.tools/go/exact/exact.go:255: not enough arguments to return
/Users/sozorogami/go/src/code.google.com/p/go.tools/go/exact/exact.go:257: x.val.Float32 undefined (type *big.Rat has no field or method Float32)
/Users/sozorogami/go/src/code.google.com/p/go.tools/go/exact/exact.go:257: not enough arguments to return
go get
到其他仓库似乎工作正常。
有什么想法吗?
英文:
I've just installed Homebrew Go 1.2.2 on OSX Mavericks. Everything seems to be running fine, except that when I try either of the following commands:
$ go get code.google.com/p/go.tools/cmd/godoc
$ go get code.google.com/p/go.tools/cmd/vet
I get this stack trace:
/Users/sozorogami/go/src/code.google.com/p/go.tools/go/exact/exact.go:255: new(big.Rat).SetFrac(x.val, int1).Float32 undefined (type *big.Rat has no field or method Float32)
/Users/sozorogami/go/src/code.google.com/p/go.tools/go/exact/exact.go:255: not enough arguments to return
/Users/sozorogami/go/src/code.google.com/p/go.tools/go/exact/exact.go:257: x.val.Float32 undefined (type *big.Rat has no field or method Float32)
/Users/sozorogami/go/src/code.google.com/p/go.tools/go/exact/exact.go:257: not enough arguments to return
go get
s to other repos seem to work fine.
Any ideas?
答案1
得分: 1
看起来他们的工作出了大问题,但是如果你查看代码库,你会发现有一个分支是1.3,另一个分支是1.2。
你可以通过以下步骤来修复它:
cd ~/go/src/code.google.com/p/go.tools/go/exact
hg up release-branch.go1.2
go get code.google.com/p/go.tools/cmd/godoc
请注意,如果你尝试更新(go get -u),代码库会回到“default”分支,然后再次失败。在更新后简单地切换到正确的分支即可。
英文:
Looks like a big fail from their part, but if you look at the repo, you can see there are a branch for 1.3 and a branch for 1.2.
You can fix it by doing this:
cd ~/go/src/code.google.com/p/go.tools/go/exact
hg up release-branch.go1.2
go get code.google.com/p/go.tools/cmd/godoc
Note that if you try to update (go get -u), the repo will go back to the 'default' branch and it will fail again. Simply update to the correct branch after the update.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论