cmd/guru: fix typo of 'hyphen' to rename to 'comma'

start|end byte offset separator is not hyphen(-), actually comma(,)

Change-Id: I344ae74d33863e9456e8cdb2f058fd70f1eedf95
Reviewed-on: https://go-review.googlesource.com/35770
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Koichi Shiraishi 2017-01-26 04:08:12 +09:00 committed by Brad Fitzpatrick
parent 61efd71121
commit f8ed2e405f

View File

@ -52,14 +52,14 @@ func parsePos(pos string) (filename string, startOffset, endOffset int, err erro
filename, offset := pos[:colon], pos[colon+1:] filename, offset := pos[:colon], pos[colon+1:]
startOffset = -1 startOffset = -1
endOffset = -1 endOffset = -1
if hyphen := strings.Index(offset, ","); hyphen < 0 { if comma := strings.Index(offset, ","); comma < 0 {
// e.g. "foo.go:#123" // e.g. "foo.go:#123"
startOffset = parseOctothorpDecimal(offset) startOffset = parseOctothorpDecimal(offset)
endOffset = startOffset endOffset = startOffset
} else { } else {
// e.g. "foo.go:#123,#456" // e.g. "foo.go:#123,#456"
startOffset = parseOctothorpDecimal(offset[:hyphen]) startOffset = parseOctothorpDecimal(offset[:comma])
endOffset = parseOctothorpDecimal(offset[hyphen+1:]) endOffset = parseOctothorpDecimal(offset[comma+1:])
} }
if startOffset < 0 || endOffset < 0 { if startOffset < 0 || endOffset < 0 {
err = fmt.Errorf("invalid offset %q in query position", offset) err = fmt.Errorf("invalid offset %q in query position", offset)