feat: add parser.SkipObjectResolution

main
sudo pacman -Syu 2022-11-28 10:31:05 +07:00
parent 854e1a8974
commit a5302aef53
No known key found for this signature in database
GPG Key ID: D6CB5C6C567C47B0
1 changed files with 2 additions and 3 deletions

View File

@ -191,7 +191,7 @@ func (ft *Formatter) formatFile(path string) error {
return nil
}
// Copy from goimports-reviser
// Copy from gofumpt, goimports-reviser
func (ft *Formatter) formatImports(
path string,
pathBytes []byte,
@ -200,8 +200,7 @@ func (ft *Formatter) formatImports(
// Parse ast
fset := token.NewFileSet()
parserMode := parser.Mode(0)
parserMode |= parser.ParseComments
parserMode := parser.ParseComments | parser.SkipObjectResolution
astFile, err := parser.ParseFile(fset, path, pathBytes, parserMode)
if err != nil {