]> Cypherpunks repositories - gostls13.git/commitdiff
text/scanner: add required ScanComments in example
authorSean Liao <sean@liao.dev>
Sat, 1 Feb 2025 16:42:22 +0000 (16:42 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 3 Feb 2025 16:46:25 +0000 (08:46 -0800)
Fixes #71133

Change-Id: I11f792bf4cb275e7bc3585cd92a4b327a3b6e368
Reviewed-on: https://go-review.googlesource.com/c/go/+/646036
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/text/scanner/scanner.go

index 6ae7a9b987423b128db1fc12639b461553eec5c8..316fb4380f753cd99944895bcc3e19a0fcd21da4 100644 (file)
@@ -50,7 +50,7 @@ func (pos Position) String() string {
 // to configure a [Scanner] such that it only recognizes (Go) identifiers,
 // integers, and skips comments, set the Scanner's Mode field to:
 //
-//     ScanIdents | ScanInts | SkipComments
+//     ScanIdents | ScanInts | ScanComments | SkipComments
 //
 // With the exceptions of comments, which are skipped if SkipComments is
 // set, unrecognized tokens are not ignored. Instead, the scanner simply