Skip to content

Commit 2a5d4bc

Browse files
committed
use go/parser.SkipObjectResolution
We don't use go/ast.Objects. Avoiding this work saves a bit of CPU and memory allocs. See golang/go#52463.
1 parent 8f1392a commit 2a5d4bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

format/format.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func Source(src []byte, opts Options) ([]byte, error) {
6868
// to ensure that using token.NoPos+1 will panic.
6969
fset.AddFile("gofumpt_base.go", 1, 10)
7070

71-
file, err := parser.ParseFile(fset, "", src, parser.ParseComments)
71+
file, err := parser.ParseFile(fset, "", src, parser.SkipObjectResolution|parser.ParseComments)
7272
if err != nil {
7373
return nil, err
7474
}

0 commit comments

Comments
 (0)