]> Cypherpunks repositories - gostls13.git/commit
go/scanner: clear all fields after Scanner reuse
authorMateusz Poliwczak <mpoliwczak34@gmail.com>
Fri, 23 Jan 2026 08:52:03 +0000 (09:52 +0100)
committerAlan Donovan <adonovan@google.com>
Mon, 26 Jan 2026 15:58:30 +0000 (07:58 -0800)
commitf809faeb8e2534da29e980ebd98dfbd4e8a7f4ba
treed2b7616ac1b4b15b2a02fe13b99fbb92d1c9d599
parent1bd5dbfc4110740f2126e0253f429dfe5f3d04ac
go/scanner: clear all fields after Scanner reuse

We were missing s.nlPos = token.NoPos in Init, but while we are here
let's make it less likely to hit this it in future.

Change-Id: Ief4c0ba2cf97bc556d901eabc8e172406a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/738680
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
src/go/scanner/scanner.go
src/go/scanner/scanner_test.go