Skip to content

Commit c0025d5

Browse files
mateusz834gopherbot
authored andcommitted
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 <[email protected]> Commit-Queue: Alan Donovan <[email protected]> Reviewed-by: Robert Findley <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Alan Donovan <[email protected]>
1 parent 4ee0df8 commit c0025d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/go/parser/error_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func expectedErrors(fset *token.FileSet, filename string, src []byte) map[token.
8888
s := errRx.FindStringSubmatch(lit)
8989
if len(s) == 3 {
9090
if s[1] == "HERE" {
91-
pos = here // start of comment
91+
pos = here // position right after the previous token prior to comment
9292
} else if s[1] == "AFTER" {
9393
pos += token.Pos(len(lit)) // end of comment
9494
} else {

0 commit comments

Comments
 (0)