]> Cypherpunks repositories - gostls13.git/commitdiff
go/token: correct the interval notation used in some panic messages
authorRob Findley <rfindley@google.com>
Mon, 17 May 2021 20:11:51 +0000 (16:11 -0400)
committerRobert Findley <rfindley@google.com>
Mon, 17 May 2021 22:19:03 +0000 (22:19 +0000)
Fix an apparent typo for the right-hand bound in a couple panic
messages, where '[' was used instead of ']'.

Fixes #46215

Change-Id: Ie419c404ca72ed085a83a2c38ea1a5d6ed326cca
Reviewed-on: https://go-review.googlesource.com/c/go/+/320510
Trust: Robert Findley <rfindley@google.com>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/token/position.go

index bbcd8b022b677f211ed28c997bd976e3ac61d8b6..0d7982c67059374be2c291fd3bd312b7a3e950d8 100644 (file)
@@ -278,7 +278,7 @@ func (f *File) Pos(offset int) Pos {
 //
 func (f *File) Offset(p Pos) int {
        if int(p) < f.base || int(p) > f.base+f.size {
-               panic(fmt.Sprintf("invalid Pos value %d (should be in [%d, %d[)", p, f.base, f.base+f.size))
+               panic(fmt.Sprintf("invalid Pos value %d (should be in [%d, %d])", p, f.base, f.base+f.size))
        }
        return int(p) - f.base
 }
@@ -346,7 +346,7 @@ func (f *File) position(p Pos, adjusted bool) (pos Position) {
 func (f *File) PositionFor(p Pos, adjusted bool) (pos Position) {
        if p != NoPos {
                if int(p) < f.base || int(p) > f.base+f.size {
-                       panic(fmt.Sprintf("invalid Pos value %d (should be in [%d, %d[)", p, f.base, f.base+f.size))
+                       panic(fmt.Sprintf("invalid Pos value %d (should be in [%d, %d])", p, f.base, f.base+f.size))
                }
                pos = f.position(p, adjusted)
        }