Closed
Description
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 the go.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.