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