summaryrefslogtreecommitdiff
path: root/libgo/go/go/ast/import.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/go/ast/import.go')
-rw-r--r--libgo/go/go/ast/import.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/libgo/go/go/ast/import.go b/libgo/go/go/ast/import.go
index 894fecdaa7e..2d4f69aaea6 100644
--- a/libgo/go/go/ast/import.go
+++ b/libgo/go/go/ast/import.go
@@ -67,12 +67,7 @@ func sortSpecs(fset *token.FileSet, f *File, specs []Spec) {
// Record positions for specs.
pos := make([]posSpan, len(specs))
for i, s := range specs {
- // Cannot use s.End(), because it looks at len(s.Path.Value),
- // and that string might have gotten longer or shorter.
- // Instead, use s.Pos()+1, which is guaranteed to be > s.Pos()
- // and still before the original end of the string, since any
- // string literal must be at least 2 characters ("" or ``).
- pos[i] = posSpan{s.Pos(), s.Pos() + 1}
+ pos[i] = posSpan{s.Pos(), s.End()}
}
// Identify comments in this range.