From c0025d5e0b3f6fca7117e9b8f4593a95e37a9fa5 Mon Sep 17 00:00:00 2001 From: Mateusz Poliwczak Date: Tue, 5 Aug 2025 18:51:09 +0200 Subject: [PATCH] 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 Commit-Queue: Alan Donovan Reviewed-by: Robert Findley LUCI-TryBot-Result: Go LUCI Auto-Submit: Alan Donovan --- src/go/parser/error_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/go/parser/error_test.go b/src/go/parser/error_test.go index a4e17dd6db..252325659c 100644 --- a/src/go/parser/error_test.go +++ b/src/go/parser/error_test.go @@ -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 { -- 2.51.0