Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: list -m -u all does not output deprecation or retraction notices if dependency is replaced #60210

Open
goto1134 opened this issue May 15, 2023 · 1 comment
Labels
GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@goto1134
Copy link

goto1134 commented May 15, 2023

What version of Go are you using (go version)?

$ go version
go version go1.20.4 darwin/arm64

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="on"
GOARCH="arm64"
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOVERSION="go1.20.4"

What did you do?

Using the following go.mod file run go list -json -m -u all

module testt

go 1.20

require (
	github.com/arungudelli/Retract-Go-Module-Versions v0.2.0
)

replace github.com/arungudelli/Retract-Go-Module-Versions => github.com/golang/protobuf v1.5.0

What did you expect to see?

A JSON with the Retracted field.

...
{
        "Path": "github.com/arungudelli/Retract-Go-Module-Versions",
        "Version": "v0.2.0",
        "Time": "2021-02-13T09:07:04Z",
        "Replace": {
                "Path": "github.com/golang/protobuf",
                "Version": "v1.5.0",
                "Time": "2021-03-18T00:15:31Z",
                "Update": {
                        "Path": "github.com/golang/protobuf",
                        "Version": "v1.5.3",
                        "Time": "2021-09-16T00:37:10Z"
                },
                "Dir": ".../go/pkg/mod/github.com/golang/protobuf@v1.5.0",
                "GoMod": ".../go/pkg/mod/cache/download/github.com/golang/protobuf/@v/v1.5.0.mod",
                "GoVersion": "1.9",
                "Deprecated": "Use the \"google.golang.org/protobuf\" module instead."
        },
        "Update": {
                "Path": "github.com/arungudelli/Retract-Go-Module-Versions",
                "Version": "v0.3.1",
                "Time": "2021-02-13T09:39:05Z"
        },
        "Dir": ".../go/pkg/mod/github.com/arungudelli/!retract-!go-!module-!versions@v0.2.0",
        "GoMod": ".../go/pkg/mod/cache/download/github.com/arungudelli/!retract-!go-!module-!versions/@v/v0.2.0.mod",
        "GoVersion": "1.16",
        "Retracted": [
                "Mistake happened in the version DO NOT USE"
        ]
}

What did you see instead?

A JSON without the Retracted field.

...
{
        "Path": "github.com/arungudelli/Retract-Go-Module-Versions",
        "Version": "v0.2.0",
        "Replace": {
                "Path": "github.com/golang/protobuf",
                "Version": "v1.5.0",
                "Time": "2021-03-18T00:15:31Z",
                "Update": {
                        "Path": "github.com/golang/protobuf",
                        "Version": "v1.5.3",
                        "Time": "2021-09-16T00:37:10Z"
                },
                "Dir": ".../go/pkg/mod/github.com/golang/protobuf@v1.5.0",
                "GoMod": ".../go/pkg/mod/cache/download/github.com/golang/protobuf/@v/v1.5.0.mod",
                "GoVersion": "1.9",
                "Deprecated": "Use the \"google.golang.org/protobuf\" module instead."
        },
        "Update": {
                "Path": "github.com/arungudelli/Retract-Go-Module-Versions",
                "Version": "v0.3.1",
                "Time": "2021-02-13T09:39:05Z"
        },
        "Dir": ".../go/pkg/mod/github.com/golang/protobuf@v1.5.0",
        "GoMod": ".../go/pkg/mod/cache/download/github.com/golang/protobuf/@v/v1.5.0.mod",
        "GoVersion": "1.9"
}

Why is it important?

Dependent packages will get the required dependency, not the replacement. As a developer, I want to be notified if the declared dependency is retracted or deprecated.

@goto1134 goto1134 changed the title cmd/list: -m -u all does not output deprecation or retracte cmd/list: -m -u all does not output deprecation or retraction notices if dependency is replaced May 15, 2023
@seankhliao seankhliao changed the title cmd/list: -m -u all does not output deprecation or retraction notices if dependency is replaced cmd/go: list -m -u all does not output deprecation or retraction notices if dependency is replaced May 15, 2023
@seankhliao
Copy link
Member

cc @bcmills

@seankhliao seankhliao added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. GoCommand cmd/go labels May 15, 2023
@bcmills bcmills added this to the Backlog milestone Feb 1, 2024
@bcmills bcmills added the modules label Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants