为了账号安全,请及时绑定邮箱和手机立即绑定

go 列表:查询“最新”没有匹配的版本

go 列表:查询“最新”没有匹配的版本

Go
牧羊人nacy 2022-09-05 17:26:11
我正在尝试在opentelemetry-collector-contrib项目上运行该命令。go list -mod=readonly -m -u -json all它失败,并出现以下错误:$ go list -mod=readonly -m -u -json allgo list -m: loading module retractions for github.com/DataDog/datadog-agent/pkg/trace/exportable@v0.0.0-20201016145401-4646cf596b02: no matching versions for query "latest"go list -m: loading module retractions for github.com/influxdata/line-protocol/v2@v2.0.0-20210428091617-0567a5134992: no matching versions for query "latest"$ echo $?1我正在使用go 1.16.5:$ go versiongo version go1.16.5 linux/amd64我已经清理了go缓存,结果相同。go clean -modcache我发现这两个模块都 https://pkg.go.dev/:github.com/DataDog/datadog-agent/pkg/trace/exportablegithub.com/influxdata/line-protocol/v2似乎确切的版本存在于 github.com/DataDog/datadog-agent/pkg/trace/exportable 而不是 github.com/influxdata/line-protocol,但无论如何,两者都报告了相同的错误。我不知道golang在这里期望什么以及如何开始解决问题。任何人都可以帮忙吗?
查看完整描述

1 回答

?
PIPIONE

TA贡献1829条经验 获得超9个赞

这似乎是一个错误(https://github.com/golang/go/issues/45305),因为在Go 1.16中引入了指令。实际上,如果省略该标志,则该命令运行正常。retractgo.mod-m


如问题线程中所述,您可以添加标志以继续执行错误:-e


$ go list -mod=readonly -m -u -e -json all


{

    "Path": "github.com/open-telemetry/opentelemetry-collector-contrib",

    "Main": true,

    "Dir": "/Users/me/go/opentelemetry-collector-contrib",

    "GoMod": "/Users/me/go/opentelemetry-collector-contrib/go.mod",

    "GoVersion": "1.16"

}

... much more

关于旗帜, :-ego help list


该标志更改了对错误包(无法找到或格式不正确的包)的处理。[...]使用该标志时,list 命令从不将错误打印为标准错误,而是使用常规打印来处理错误的包。错误的包将具有非空的导入路径和非 nil 的错误字段;其他信息可能丢失,也可能不丢失(归零)。-e-e


该错误已在Go 1.17中修复。


查看完整回答
反对 回复 2022-09-05
  • 1 回答
  • 0 关注
  • 401 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号