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: go list -m -json GoMod field is not populated sometimes #44289

Closed
hyangah opened this issue Feb 16, 2021 · 4 comments
Closed

cmd/go: go list -m -json GoMod field is not populated sometimes #44289

hyangah opened this issue Feb 16, 2021 · 4 comments
Labels
FrozenDueToAge GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. okay-after-beta1 Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1
Milestone

Comments

@hyangah
Copy link
Contributor

hyangah commented Feb 16, 2021

go version: 1.16rc1

I ran the go list command back to back, and noticed the GoMod field was not populated during the very first try.

$ GOPROXY=direct GOSUMDB=off GOPATH=/tmp/x /Users/hakim/sdk/go1.16rc1/bin/go  list -m -json --versions github.com/hyangah/retracttest/a@latest
{
        "Path": "github.com/hyangah/retracttest/a",
        "Version": "v0.0.0-20201117044135-c0d2dc84e45f",
        "Time": "2020-11-17T04:41:35Z",
        "GoVersion": "1.15"
}
$ GOPROXY=direct GOSUMDB=off GOPATH=/tmp/x /Users/hakim/sdk/go1.16rc1/bin/go  list -m -json --versions github.com/hyangah/retracttest/a@latest
{
        "Path": "github.com/hyangah/retracttest/a",
        "Version": "v0.0.0-20201117044135-c0d2dc84e45f",
        "Time": "2020-11-17T04:41:35Z",
        "GoMod": "/tmp/x/pkg/mod/cache/download/github.com/hyangah/retracttest/a/@v/v0.0.0-20201117044135-c0d2dc84e45f.mod",
        "GoVersion": "1.15"
}
@seankhliao seankhliao added GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Feb 16, 2021
@jayconrod jayconrod added this to the Go1.17 milestone Feb 16, 2021
@iwdgo
Copy link
Contributor

iwdgo commented Apr 12, 2021

Issue still occurs on go1.16.3. The first go list command loads the cache reported by GoMod as in the second use of the command. Manually deleting the folder reported by GoMod repeats the behavior.

On tip, issue seems solved probably because of CL 293689 which updates #40775 by refactoring modload.LoadFile(ctx)

It seems that issue can be closed for now.

@jayconrod jayconrod added the okay-after-beta1 Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1 label May 17, 2021
@jayconrod jayconrod modified the milestones: Go1.17, Go1.18 Jul 29, 2021
@ianlancetaylor
Copy link
Member

This is in the Go1.18 milestone. Is it likely to happen for 1.18? Thanks.

@ianlancetaylor
Copy link
Member

@bcmills This is in the 1.18 milestone; time to move to 1.19? Thanks.

@bcmills bcmills modified the milestones: Go1.18, Backlog Jan 28, 2022
@bcmills bcmills added the modules label Feb 1, 2022
@bcmills
Copy link
Contributor

bcmills commented Feb 1, 2022

On tip, issue seems solved probably because of CL 293689 which updates #40775 by refactoring modload.LoadFile(ctx)

It seems that issue can be closed for now.

Closing on the theory that this may have been fixed by changes in modload/list.go and/or cmd/go/internal/list/list.go (there have been substantial changes in both since 1.16rc1).

Please reopen (or open a new issue) if you observe this in Go 1.18beta2 or higher.

@bcmills bcmills closed this as completed Feb 1, 2022
@golang golang locked and limited conversation to collaborators Feb 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. okay-after-beta1 Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1
Projects
None yet
Development

No branches or pull requests

7 participants