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
Using the replace directive on go.mod with a local FilePath containing an @ character is breaking the module path. Per the pkg docs, EBNF for FilePath says platform specific relative or absolute file path.
Along with the fix for the original problem reported, the changes also address an the error message when the @ char is present in the replace directive's new path, if specified as a import path. Though the @ character is not allowed in an import path, it throws an incorrect error, i.e.
go mod edit -replace=golang.org/x/tools=github.com/@x/tools@v2
go: -replace=golang.org/x/tools=github.com/@x/tools@v2: invalid new path: malformed import path "github.com/": trailing slash
It should have ideally warned about the @ character present in the module path. With the current CL, it rightly updates the error as