从pkg.go.dev中删除旧版本

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

remove old versions from pkg.go.dev

问题

我有一个在GitHub上的Go包。在GitHub上,我删除了旧版本的标签。但是在https://pkg.go.dev/example.com/username/pkg上仍然显示这些旧版本。

我想知道如何完全从pkg.go.dev中删除这些旧包。

英文:

I have this Go package on GitHub. and on GitHub I've delete old version tags. but on:
https://pkg.go.dev/example.com/username/pkg it still showing those old versions.

I'm wondering how to completely delete those old package from pkg.go.dev

答案1

得分: 5

Go模块版本是不可变的:你不能简单地通过删除标签来使它们无效,因为如果你重新使用这些标签,会导致现有用户的校验和不匹配

相反,你可以在你的go.mod文件中使用retract指令,来警告用户避免使用特定范围内的版本,并且默认情况下go命令不会添加对这些版本的新依赖。

英文:

Go module versions are immutable: you cannot invalidate them by simply removing tags, because if you then reused those tags you would cause checksum mismatches for existing users.

Instead, you can use the retract directive in your go.mod file to warn users to avoid versions in a specific range, and to cause the go command not to add new dependencies on those versions by default.

huangapple
  • 本文由 发表于 2021年8月27日 23:23:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/68955904.html
匿名

发表评论

匿名网友

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

确定