mirror of https://github.com/golang/go.git
go/ast: minor cleanup
It's better to use IsValid() then checking a (possibly partially set up) position against NoPos directly. R=dsymonds CC=golang-dev https://golang.org/cl/6855099
This commit is contained in:
parent
178c8578d5
commit
bb7c3c6803
|
|
@ -20,7 +20,7 @@ func SortImports(fset *token.FileSet, f *File) {
|
|||
break
|
||||
}
|
||||
|
||||
if d.Lparen == token.NoPos {
|
||||
if !d.Lparen.IsValid() {
|
||||
// Not a block: sorted by default.
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue