安装golang的保护套时出现问题

时间:2019-05-07 07:37:37

标签: go code-coverage

我有一些代码。 但当 我尝试进行覆盖测试并得到响应:

'go get -u github.com/gregoryv/uncover/...
go test -coverprofile /tmp/c.out
uncover /tmp/c.out'

我尝试安装封面包:

go get code.google.com/p/go.tools/cmd/cover

但出现错误

package code.google.com/p/go.tools/cmd/cover: unrecognized import path "code.google.com/p/go.tools/cmd/cover" (parse https://code.google.com/p/go.tools/cmd/cover?go-get=1: no go-import meta tags (meta tag github.com/golang/go did not match import path code.google.com/p/go.tools/cmd/cover))

系统:Ubuntu 18.04

1 个答案:

答案 0 :(得分:0)

正确的路径是:

go get golang.org/x/tools/cmd/cover