Assume I have:
f, err := parser.ParseFile(fset, srcPath, nil, 0)
How can I get back the srcPath from f
?
CodePudding user response:
Use fset.Position(f.Package).Filename
to get srcPath
from f
.
Assume I have:
f, err := parser.ParseFile(fset, srcPath, nil, 0)
How can I get back the srcPath from f
?
CodePudding user response:
Use fset.Position(f.Package).Filename
to get srcPath
from f
.