Skip to content

proposal: cmd/go: modify the whole workspace with go get #61397

@goto1134

Description

@goto1134

Consider the following scenario when the user has an intention to upgrade or downgrade a dependency in the workspace:

  1. Clone https://github.com/sergunya/my_workspace
  2. 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)
  3. 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:

  1. Clone https://github.com/sergunya/my_workspace
  2. run go get github.com/rs/zerolog@latest
  3. cd cmd/my_app
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Incoming

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions