Is that correct that "go get -u" inside a module directory will break dependent package's go.mod requirement? #33465
Labels
FrozenDueToAge
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Hi, I am not sure how to express this clearly in English. I will just show all the steps and what I got from
go.mod
andgo.sum
in each step in the following.I have a module directory which has
go.mod
andmain.go
.go.mod:
main.go:
and then I exeucte
go.mod
is unchanged here andgo.sum
is created as follows:So far, everything looks fine.
The weird part is when I do
go get -u pkg@sameVersion
. I did execute the following command:Note that I am just getting the same version again. I expected no change.
But Now, everything changed.
go.mod:
go.sum:
This really doesn't look correct to me.
Because if you check https://github.com/go-pg/pg/blob/v9.0.0-beta.2/go.mod and https://github.com/go-pg/pg/blob/v9.0.0-beta.2/go.sum, you can see that the only package I imported does require
github.com/jinzhu/inflection v0.0.0-20180308033659-04140366298a
for instance. BUTgo get -u pkg@sameVersion
breaks it and gives megit.luolix.top/jinzhu/inflection v1.0.0 // indirect
in my go.mod.I really don't understand the mess in my go.mod. Why did
go get -u
add the incorrect indirect dependencies to my go.mod? Right now, I am really afraid to rungo get -u
. Is this expected?The text was updated successfully, but these errors were encountered: