You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
run go get github.com/rs/zerolog@latest or go get -u github.com/rs/zerolog or go get github.com/rs/zerolog@1.26.0 (the latter is for downgrade)
the root go.mod is modified, and the module cmd/my_app/go.mod file is not modified.
As a result, for the upgrade action, the buildlist contains the latest version of the dependency, and the inner module lists an outdated dependency version.
For the downgrade action, since the inner module contains a higher version, the buildlist does not change, so the downgrade has no effect on the project.
Consider applying the go get command to the whole workspace.
If an upgrade happens, all the modules containing a dependency should be upgraded.
If a downgrade was called, all the modules that contain a dependency should be downgraded.
Indeed, it is a way to solve the problem with upgrades, but for the downgrades, unfortunately, it doesn't work, since it will replace the lower version with a higher one
This is a lot like #50750, in that there are really two modes you might be operating in:
If the workspace is a set of modules that are all under your control, you probably want to update them all at the same time.
On the other hand, if you are working on a patch to send to some upstream maintainer, you probably want to avoid unnecessary changes to their module.
For #50750, we have two separate commands (go work sync and go mod tidy respectively) intended for those two modes of use. But we don't currently have a workspace-scoped analogue for go get.
Consider the following scenario when the user has an intention to upgrade or downgrade a dependency in the workspace:
go get github.com/rs/zerolog@latest
orgo get -u github.com/rs/zerolog
orgo get github.com/rs/zerolog@1.26.0
(the latter is for downgrade)go.mod
is modified, and the modulecmd/my_app/go.mod
file is not modified.As a result, for the upgrade action, the buildlist contains the latest version of the dependency, and the inner module lists an outdated dependency version.
For the downgrade action, since the inner module contains a higher version, the buildlist does not change, so the downgrade has no effect on the project.
Consider applying the
go get
command to the whole workspace.Additional scenario:
go get github.com/rs/zerolog@latest
cd cmd/my_app
go mod tidy
As a result,
cmd/my_app/go.mod
does not change, but thegithub.com/rs/zerolog
line does not align with the buildlist.Consider changing the
require
directives if with the version from buildlist ongo mod tidy
.The text was updated successfully, but these errors were encountered: