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

Open
hyangah opened this issue Feb 16, 2021 · 1 comment
Open

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

hyangah opened this issue Feb 16, 2021 · 1 comment

Comments

@hyangah
Copy link
Contributor

@hyangah 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"
}
@iwdgo
Copy link
Contributor

@iwdgo 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 removed this from the Go1.17 milestone Jul 29, 2021
@jayconrod jayconrod added this to the Go1.18 milestone Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants