<feed xmlns='http://www.w3.org/2005/Atom'>
<title>go/src/bufio/scan_test.go, branch bench-before</title>
<subtitle>Fork of Go programming language with my patches.</subtitle>
<id>http://git.kilabit.info/go/atom?h=bench-before</id>
<link rel='self' href='http://git.kilabit.info/go/atom?h=bench-before'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/'/>
<updated>2024-01-24T21:01:14Z</updated>
<entry>
<title>bufio: realign struct Scanner</title>
<updated>2024-01-24T21:01:14Z</updated>
<author>
<name>Shulhan</name>
<email>m.shulhan@gmail.com</email>
</author>
<published>2023-09-16T16:18:02Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=004f47502ca074bd2591e215512fd2e18bd8659a'/>
<id>urn:sha1:004f47502ca074bd2591e215512fd2e18bd8659a</id>
<content type='text'>
This reduce the Scanner allocation size from 112 to 72 bytes.
</content>
</entry>
<entry>
<title>all: clean unnecessary casts for test files</title>
<updated>2023-09-22T16:22:42Z</updated>
<author>
<name>Jes Cok</name>
<email>xigua67damn@gmail.com</email>
</author>
<published>2023-09-19T10:36:19Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=9b883484a8c1c0fb556ac0d04cf24e54dff7eb47'/>
<id>urn:sha1:9b883484a8c1c0fb556ac0d04cf24e54dff7eb47</id>
<content type='text'>
This is a follow up of CL 528696.

Change-Id: I5b71eabedb12567c4b1b36f7182a3d2b0ed662a5
GitHub-Last-Rev: acaf3ac11c38042ad27b99e1c70a3c9f1a554a15
GitHub-Pull-Request: golang/go#62713
Reviewed-on: https://go-review.googlesource.com/c/go/+/529197
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
Auto-Submit: Ian Lance Taylor &lt;iant@google.com&gt;
Reviewed-by: Matthew Dempsky &lt;mdempsky@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
</content>
</entry>
<entry>
<title>bufio: test for exact error value in TestNegativeEOFReader and TestLargeReader</title>
<updated>2020-06-17T14:47:32Z</updated>
<author>
<name>Dmitri Shuralyov</name>
<email>dmitshur@golang.org</email>
</author>
<published>2020-06-16T17:08:47Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=dea6d928f6c293631ce93bd3a3bb8b4020188954'/>
<id>urn:sha1:dea6d928f6c293631ce93bd3a3bb8b4020188954</id>
<content type='text'>
CL 225357 added tests for Scanner not panicking on bad readers.
CL 225557 created a named error value that is returned instead.
CL 237739 documents that the bufio.ErrBadReadCount is returned
when bufio.Scanner is used with an invalid io.Reader.

This suggests we wouldn't want that behavior to be able to change
without a test noticing it, so modify the tests to check for the
exact error value instead of just any non-nil one.

For #38053.

Change-Id: I4b0b8eb6804ebfe2c768505ddb94f0b1017fcf8b
Reviewed-on: https://go-review.googlesource.com/c/go/+/238217
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
</entry>
<entry>
<title>bufio: don't panic when Scanner sees an impossible Read count</title>
<updated>2020-03-25T19:16:39Z</updated>
<author>
<name>Ian Lance Taylor</name>
<email>iant@golang.org</email>
</author>
<published>2020-03-25T03:09:11Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=b878d8db66faf9f8d9b2ff394123cdde21d93f8d'/>
<id>urn:sha1:b878d8db66faf9f8d9b2ff394123cdde21d93f8d</id>
<content type='text'>
Fixes #38053

Change-Id: Ib0f9777f37eeaa07eb8ecb6df3e97e9d4b46dcd8
Reviewed-on: https://go-review.googlesource.com/c/go/+/225357
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</content>
</entry>
<entry>
<title>all: remove redundant returns</title>
<updated>2017-04-19T20:03:51Z</updated>
<author>
<name>Daniel Martí</name>
<email>mvdan@mvdan.cc</email>
</author>
<published>2017-04-19T19:38:10Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=ff7994ac1030525be5229a9f665d01ed50cd945e'/>
<id>urn:sha1:ff7994ac1030525be5229a9f665d01ed50cd945e</id>
<content type='text'>
Returns at the end of func bodies where the funcs have no return values
are pointless.

Change-Id: I0da5ea78671503e41a9f56dd770df8c919310ce5
Reviewed-on: https://go-review.googlesource.com/41093
Run-TryBot: Daniel Martí &lt;mvdan@mvdan.cc&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
</entry>
<entry>
<title>all: delete dead test code</title>
<updated>2016-03-21T07:10:08Z</updated>
<author>
<name>Dominik Honnef</name>
<email>dominik@honnef.co</email>
</author>
<published>2016-03-20T23:13:36Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=b2cf57104090b0cc148c0608f10f33cdfb48ec11'/>
<id>urn:sha1:b2cf57104090b0cc148c0608f10f33cdfb48ec11</id>
<content type='text'>
This deletes unused code and helpers from tests.

Change-Id: Ie31d46115f558ceb8da6efbf90c3c204e03b0d7e
Reviewed-on: https://go-review.googlesource.com/20927
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
</entry>
<entry>
<title>all: fix typos and spelling</title>
<updated>2016-02-24T18:42:29Z</updated>
<author>
<name>Martin Möhrmann</name>
<email>martisch@uos.de</email>
</author>
<published>2016-02-24T10:55:20Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=fdd0179bb1fdd70d405929b78c7d2fb6b61369b0'/>
<id>urn:sha1:fdd0179bb1fdd70d405929b78c7d2fb6b61369b0</id>
<content type='text'>
Change-Id: Icd06d99c42b8299fd931c7da821e1f418684d913
Reviewed-on: https://go-review.googlesource.com/19829
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
</entry>
<entry>
<title>bufio: fix scanning with a final empty token.</title>
<updated>2015-09-25T21:46:13Z</updated>
<author>
<name>Rob Pike</name>
<email>r@golang.org</email>
</author>
<published>2015-09-24T20:10:00Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=ec12754700c5635c916361c6cd95718f57a8f1c9'/>
<id>urn:sha1:ec12754700c5635c916361c6cd95718f57a8f1c9</id>
<content type='text'>
The Scan function's interface to the split function was not sufficient
to handle an empty final token in a pure function; state was required.
This was ugly.

We introduce a special error value that a split function can return
that signals that this token is OK, but is the last one and scanning
should stop immediately _after_ this token.

The same effect could be achieved using the same trick (a special
error value) and checking for that error after Scan finishes, but it's
a little clumsy. Providing a published sentinel value in bufio is
cleaner and means everyone can use the same trick. The result
is an error-free scan.

Rewrite the test (that was only barely working) to use the value
and be more robust.

Also write a new example showing how to do it.

Fixes #11836

Change-Id: Iaae77d0f95b4a2efa0175ced94d93c66353079e8
Reviewed-on: https://go-review.googlesource.com/14924
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
</entry>
<entry>
<title>bufio: allow Scanner to accept a user-provided buffer</title>
<updated>2015-09-18T18:56:49Z</updated>
<author>
<name>Rob Pike</name>
<email>r@golang.org</email>
</author>
<published>2015-09-15T21:14:44Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=13be616e560411f6f252f728deed3c0b3e145fed'/>
<id>urn:sha1:13be616e560411f6f252f728deed3c0b3e145fed</id>
<content type='text'>
Add Scanner.Buffer, which lets the user give a buffer to
the scanner and set the maximum token size.

We call it Buffer not SetBuffer for consistency with Split, which
perhaps should have been called SetSplit; too late regardless.

Both Buffer and Split panic if they are called after Scan. The
panic in Split is new, but the comment on the method already
said it needed to be called first, so we might as well add the
verification while we're doing it for Buffer.

This method allows precise user control of storage.

Fixes #11702.

Change-Id: I80e3d0e3830562fdabd4f7b08f322e1378248c39
Reviewed-on: https://go-review.googlesource.com/14599
Reviewed-by: Andrew Gerrand &lt;adg@golang.org&gt;
Reviewed-by: roger peppe &lt;rogpeppe@gmail.com&gt;
</content>
</entry>
<entry>
<title>bufio: remove unused 'panicked' variable from test</title>
<updated>2014-11-06T04:22:29Z</updated>
<author>
<name>Andrew Gerrand</name>
<email>adg@golang.org</email>
</author>
<published>2014-11-06T04:22:29Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=908dcab6f854503a4616b6a20aa1e9eba9ecea66'/>
<id>urn:sha1:908dcab6f854503a4616b6a20aa1e9eba9ecea66</id>
<content type='text'>
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/166230044
</content>
</entry>
</feed>
