You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using golang.org/x/mod/modfile.Parse() to parse a go.mod file into file File, I expect file.Module.Mod to have both Path and Version set. Instead, only Path is set - including the version as last element.
The go.mod contained this line: module github.com/onsi/ginkgo/v2 (the exact package being not important), running in dlv I confirmed the behavior:
(dlv) p file.Module.Mod
golang.org/x/mod/module.Version {
Path: "github.com/onsi/ginkgo/v2",
Version: "",}
I used file, err := modfile.Parse(fmt.Sprintf("go.mod@%v", version), fileContents, nil) to parse the file, no error was returned. The filename given as argument should be irrelevant to this problem.
Please either change the code to have Path and Version set or document this is not the case and what users should do instead.
Version details
go version go1.17.5 linux/amd64
golang.org/x/mod version v0.5.1
The text was updated successfully, but these errors were encountered:
When using
golang.org/x/mod/modfile.Parse()
to parse ago.mod
file intofile File
, I expectfile.Module.Mod
to have bothPath
andVersion
set. Instead, only Path is set - including the version as last element.The
go.mod
contained this line:module github.com/onsi/ginkgo/v2
(the exact package being not important), running indlv
I confirmed the behavior:I used
file, err := modfile.Parse(fmt.Sprintf("go.mod@%v", version), fileContents, nil)
to parse the file, no error was returned. The filename given as argument should be irrelevant to this problem.Please either change the code to have
Path
andVersion
set or document this is not the case and what users should do instead.Version details
The text was updated successfully, but these errors were encountered: