Consider the following scenario when the user has an intention to upgrade or downgrade a dependency in the workspace:
- Clone https://github.com/sergunya/my_workspace
- 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.
Additional scenario:
- Clone https://github.com/sergunya/my_workspace
- run
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 the github.com/rs/zerolog line does not align with the buildlist.
Consider changing the require directives if with the version from buildlist on go mod tidy.
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@latestorgo get -u github.com/rs/zerologorgo get github.com/rs/zerolog@1.26.0(the latter is for downgrade)go.modis modified, and the modulecmd/my_app/go.modfile 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 getcommand to the whole workspace.Additional scenario:
go get github.com/rs/zerolog@latestcd cmd/my_appgo mod tidyAs a result,
cmd/my_app/go.moddoes not change, but thegithub.com/rs/zerologline does not align with the buildlist.Consider changing the
requiredirectives if with the version from buildlist ongo mod tidy.