text/scanner: SkipComments is ignored without ScanComments #71133
Labels
Bug
Issues describing a bug in the Go implementation.
Documentation
Issues describing a change to documentation.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Go version
go1.23.4
Output of
go env
in your module/workspace:What did you do?
The
text/scanner
docs say:However, it seems that
SkipComments
only works as advertised when combined withScanComments
, despite the example clearly implying otherwise.The following code demonstrates (see go.dev.play link):
What did you see happen?
The output is:
What did you expect to see?
I would expect the output to be:
The text was updated successfully, but these errors were encountered: