mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
go/parser: correct comment in expectedErrors
If `here` were already the start of the comment, then the `pos = here` assignment would be redundant. Since pos is already the start of the comment. Change-Id: I793334988951ae5441327cb62d7524b423155b74 Reviewed-on: https://go-review.googlesource.com/c/go/+/693295 Reviewed-by: Alan Donovan <adonovan@google.com> Commit-Queue: Alan Donovan <adonovan@google.com> Reviewed-by: Robert Findley <rfindley@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Alan Donovan <adonovan@google.com>
This commit is contained in:
parent
4ee0df8c46
commit
c0025d5e0b
1 changed files with 1 additions and 1 deletions
|
|
@ -88,7 +88,7 @@ func expectedErrors(fset *token.FileSet, filename string, src []byte) map[token.
|
|||
s := errRx.FindStringSubmatch(lit)
|
||||
if len(s) == 3 {
|
||||
if s[1] == "HERE" {
|
||||
pos = here // start of comment
|
||||
pos = here // position right after the previous token prior to comment
|
||||
} else if s[1] == "AFTER" {
|
||||
pos += token.Pos(len(lit)) // end of comment
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue