From f8ed2e405fdcbb42c55233531ad98721e6d1cb3e Mon Sep 17 00:00:00 2001 From: Koichi Shiraishi Date: Thu, 26 Jan 2017 04:08:12 +0900 Subject: [PATCH] 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 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- cmd/guru/pos.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/guru/pos.go b/cmd/guru/pos.go index 591aad8e5c..2e659fe424 100644 --- a/cmd/guru/pos.go +++ b/cmd/guru/pos.go @@ -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)