x/mod/modfile: document what the path is used for in Parse #45149
Labels
Documentation
Issues describing a change to documentation.
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
The
Parse
function takes in a file name as the first argument. It does not seem obvious to me why a parse function should care about the file name at all in order to parse the contents of the thego.mod
file. We should document better what this is used for and whether it is required.Without studying the code too deeply, it seems that the filename is primarily used in error reporting and also to populate
modfile.File.Syntax.Name
but otherwise has not semantic impact on how the file is parsed.In my situation, I don't have the original go.mod path on hand and it's not clear to me whether I should spend the effort to produce the exact right one or just put some arbitrary path.
The text was updated successfully, but these errors were encountered: