cl.NewPackage: rm fset *token.FileSet

This commit is contained in:
xushiwei
2024-04-22 20:23:01 +08:00
parent 72084b5648
commit ead09d94aa
4 changed files with 6 additions and 9 deletions

View File

@@ -58,7 +58,7 @@ func (p *context) importPkg(pkg *types.Package) {
if obj, ok := obj.(*types.Func); ok {
if pos := obj.Pos(); pos != token.NoPos {
f := fset.File(pos)
if fp := f.PositionFor(pos, false); fp.Line > 2 {
if fp := f.Position(pos); fp.Line > 2 {
lines, err := contentOf(contents, fp.Filename)
if err != nil {
panic(err)