From: Robert Griesemer Date: Tue, 27 Nov 2012 01:17:49 +0000 (-0800) Subject: go/ast: minor cleanup X-Git-Tag: go1.1rc2~1776 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=bb7c3c680323a019d7e6cfa6a8eb291e676524e3;p=gostls13.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 --- diff --git a/src/pkg/go/ast/import.go b/src/pkg/go/ast/import.go index 2d4f69aaea..a68a4840f8 100644 --- a/src/pkg/go/ast/import.go +++ b/src/pkg/go/ast/import.go @@ -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 }