Golang – 问题出现在使用”go get”命令获取基本命令”vet”和”godoc”时。

huangapple go评论84阅读模式
英文:

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 gets 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.

huangapple
  • 本文由 发表于 2014年6月12日 18:28:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/24182134.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定