Skip to content

Commit

Permalink
use go/parser.SkipObjectResolution
Browse files Browse the repository at this point in the history
We don't use go/ast.Objects.
Avoiding this work saves a bit of CPU and memory allocs.

See golang/go#52463.
  • Loading branch information
mvdan committed Jun 10, 2022
1 parent 8f1392a commit 2a5d4bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion format/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func Source(src []byte, opts Options) ([]byte, error) {
// to ensure that using token.NoPos+1 will panic.
fset.AddFile("gofumpt_base.go", 1, 10)

file, err := parser.ParseFile(fset, "", src, parser.ParseComments)
file, err := parser.ParseFile(fset, "", src, parser.SkipObjectResolution|parser.ParseComments)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 2a5d4bc

Please sign in to comment.