From bb7c3c680323a019d7e6cfa6a8eb291e676524e3 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Mon, 26 Nov 2012 17:17:49 -0800 Subject: [PATCH] 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 --- src/pkg/go/ast/import.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 } -- 2.48.1