go mod #14
wangjc0216
started this conversation in
Go
go mod
#14
Replies: 2 comments
|
如prometheus,因为项目不满足语义版本控制。 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
一些零散的点:
go.mod 会指定某一个具体版本,如果版本通过go get被指定,那么对应的依赖版本也会对应的upgrade和downgrade到具体版本。
//indirect则表示的是自己依赖的module所间接依赖的版本。
go mod edit -replace=@Version=
go mod 会在一个major version中选择一个最高版本的,因为go module编写规则中,会认定同一个大版本中,版本是向后兼容的。
以github.com/pierrec/lz4为例,当我执行go get github.com/pierrec/lz4 的时候,会获取v2.6.1+incompatible版本。
伪版本:go list -m -versions github.com/pierrec/lz4 ,可以看到legacy go中的各个版本,和git tag可以对应。
All reactions