mirror of
https://github.com/golang/go
synced 2024-11-18 11:04:42 -07:00
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:
parent
61efd71121
commit
f8ed2e405f
@ -52,14 +52,14 @@ func parsePos(pos string) (filename string, startOffset, endOffset int, err erro
|
||||
filename, offset := pos[:colon], pos[colon+1:]
|
||||
startOffset = -1
|
||||
endOffset = -1
|
||||
if hyphen := strings.Index(offset, ","); hyphen < 0 {
|
||||
if comma := strings.Index(offset, ","); comma < 0 {
|
||||
// e.g. "foo.go:#123"
|
||||
startOffset = parseOctothorpDecimal(offset)
|
||||
endOffset = startOffset
|
||||
} else {
|
||||
// e.g. "foo.go:#123,#456"
|
||||
startOffset = parseOctothorpDecimal(offset[:hyphen])
|
||||
endOffset = parseOctothorpDecimal(offset[hyphen+1:])
|
||||
startOffset = parseOctothorpDecimal(offset[:comma])
|
||||
endOffset = parseOctothorpDecimal(offset[comma+1:])
|
||||
}
|
||||
if startOffset < 0 || endOffset < 0 {
|
||||
err = fmt.Errorf("invalid offset %q in query position", offset)
|
||||
|
Loading…
Reference in New Issue
Block a user