<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/go-git.git/src/bytes/example_test.go, branch dev.go2go</title>
<subtitle>github.com: golang/go
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/'/>
<entry>
<title>bytes: add example for (*Buffer).Bytes</title>
<updated>2020-11-11T20:51:00+00:00</updated>
<author>
<name>Federico Guerinoni</name>
<email>guerinoni.federico@gmail.com</email>
</author>
<published>2020-11-08T14:35:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=141fa337ad2f118e4e99dc554e95c336810a07cf'/>
<id>141fa337ad2f118e4e99dc554e95c336810a07cf</id>
<content type='text'>
Change-Id: I49ac604530fff7928fa15de07563418b104da5e4
Reviewed-on: https://go-review.googlesource.com/c/go/+/268260
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Trust: Giovanni Bajo &lt;rasky@develer.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I49ac604530fff7928fa15de07563418b104da5e4
Reviewed-on: https://go-review.googlesource.com/c/go/+/268260
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Trust: Giovanni Bajo &lt;rasky@develer.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bytes: add examples for ToTitleSpecial, ToUpperSpecial and ToLowerSpecial</title>
<updated>2019-03-01T14:56:41+00:00</updated>
<author>
<name>Ketan Parmar</name>
<email>ketanbparmar@gmail.com</email>
</author>
<published>2019-02-08T06:28:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=1f3d38fdaaff88d7ce711612fbe9b7fc7182efd7'/>
<id>1f3d38fdaaff88d7ce711612fbe9b7fc7182efd7</id>
<content type='text'>
Change-Id: If700a150492181f68e23e90ef829ff9eaf7ca7b5
Reviewed-on: https://go-review.googlesource.com/c/161737
Run-TryBot: Andrew Bonventre &lt;andybons@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Andrew Bonventre &lt;andybons@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: If700a150492181f68e23e90ef829ff9eaf7ca7b5
Reviewed-on: https://go-review.googlesource.com/c/161737
Run-TryBot: Andrew Bonventre &lt;andybons@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Andrew Bonventre &lt;andybons@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bytes: add ReplaceAll example</title>
<updated>2018-12-13T19:40:13+00:00</updated>
<author>
<name>dupoxy</name>
<email>dupoxy@users.noreply.github.com</email>
</author>
<published>2018-12-13T18:52:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=57de1af78c30d7f06e788b33c96341f286f36f4d'/>
<id>57de1af78c30d7f06e788b33c96341f286f36f4d</id>
<content type='text'>
Change-Id: I36cc0b68a5a47ac78982b05118c58723c9c6648c
GitHub-Last-Rev: 0704d9569407d8b84d1ddcf845b759f7daa91ec1
GitHub-Pull-Request: golang/go#29203
Reviewed-on: https://go-review.googlesource.com/c/153842
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I36cc0b68a5a47ac78982b05118c58723c9c6648c
GitHub-Last-Rev: 0704d9569407d8b84d1ddcf845b759f7daa91ec1
GitHub-Pull-Request: golang/go#29203
Reviewed-on: https://go-review.googlesource.com/c/153842
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bytes: add example for Buffer.Len</title>
<updated>2018-08-30T19:10:14+00:00</updated>
<author>
<name>Erin Masatsugu</name>
<email>erin.masatsugu@gmail.com</email>
</author>
<published>2018-08-30T18:27:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=5e755e9d6d9d5ab1268dc7c2d18a08b543d988c9'/>
<id>5e755e9d6d9d5ab1268dc7c2d18a08b543d988c9</id>
<content type='text'>
Change-Id: Ide50aba940727a7b32cd33dea5315050f1a34717
Reviewed-on: https://go-review.googlesource.com/132237
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: Ide50aba940727a7b32cd33dea5315050f1a34717
Reviewed-on: https://go-review.googlesource.com/132237
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bytes, strings: restore O(1) behavior of IndexAny(s, "") and LastIndexAny(s, "")</title>
<updated>2017-11-15T21:26:05+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2017-11-14T02:30:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=2a166c93a3d2a7ba73e129649b7b41b6c696e74a'/>
<id>2a166c93a3d2a7ba73e129649b7b41b6c696e74a</id>
<content type='text'>
CL 65851 (bytes) and CL 65910 (strings) “improve[d] readability”
by removing the special case that bypassed the whole function body
when chars == "". In doing so, yes, the function was unindented a
level, which is nice, but the runtime of that case went from O(1) to O(n)
where n = len(s).

I don't know if anyone's code depends on the O(1) behavior in this case,
but quite possibly someone's does.

This CL adds the special case back, with a comment to prevent future
deletions, and without reindenting each function body in full.

Change-Id: I5aba33922b304dd1b8657e6d51d6c937a7f95c81
Reviewed-on: https://go-review.googlesource.com/78112
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
CL 65851 (bytes) and CL 65910 (strings) “improve[d] readability”
by removing the special case that bypassed the whole function body
when chars == "". In doing so, yes, the function was unindented a
level, which is nice, but the runtime of that case went from O(1) to O(n)
where n = len(s).

I don't know if anyone's code depends on the O(1) behavior in this case,
but quite possibly someone's does.

This CL adds the special case back, with a comment to prevent future
deletions, and without reindenting each function body in full.

Change-Id: I5aba33922b304dd1b8657e6d51d6c937a7f95c81
Reviewed-on: https://go-review.googlesource.com/78112
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bytes: make ExampleTrimLeft and ExampleTrimRight match</title>
<updated>2017-11-15T21:25:13+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2017-11-14T02:21:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=e7628bee6e8ddac41b213d9ed0b2d6e4051674e4'/>
<id>e7628bee6e8ddac41b213d9ed0b2d6e4051674e4</id>
<content type='text'>
ExampleTrimLeft was inexplicably complex.

Change-Id: I13ca81bdeba728bdd632acf82e3a1101d29b9f39
Reviewed-on: https://go-review.googlesource.com/78111
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
Reviewed-by: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ExampleTrimLeft was inexplicably complex.

Change-Id: I13ca81bdeba728bdd632acf82e3a1101d29b9f39
Reviewed-on: https://go-review.googlesource.com/78111
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
Reviewed-by: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bytes: change ExampleReader_Len to use a non-ASCII string</title>
<updated>2017-11-15T21:25:07+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2017-11-14T02:20:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=22671e734473d3cd088958a00826c1adf936032c'/>
<id>22671e734473d3cd088958a00826c1adf936032c</id>
<content type='text'>
This should help make clear that Len is not counting runes.
Also delete empty string, which doesn't add much.

Change-Id: I1602352df1897fef6e855e9db0bababb8ab788ca
Reviewed-on: https://go-review.googlesource.com/78110
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
Reviewed-by: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This should help make clear that Len is not counting runes.
Also delete empty string, which doesn't add much.

Change-Id: I1602352df1897fef6e855e9db0bababb8ab788ca
Reviewed-on: https://go-review.googlesource.com/78110
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
Reviewed-by: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bytes: add examples of Equal and IndexByte</title>
<updated>2017-10-16T03:34:28+00:00</updated>
<author>
<name>Javier Segura</name>
<email>javism@gmail.com</email>
</author>
<published>2017-10-15T21:20:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=7128ed0501cc73a4d644ba1c510a152d680367a9'/>
<id>7128ed0501cc73a4d644ba1c510a152d680367a9</id>
<content type='text'>
Change-Id: Ibf3179d0903eb443c89b6d886802c36f8d199898
Reviewed-on: https://go-review.googlesource.com/70933
Reviewed-by: Emmanuel Odeke &lt;emm.odeke@gmail.com&gt;
Run-TryBot: Emmanuel Odeke &lt;emm.odeke@gmail.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: Ibf3179d0903eb443c89b6d886802c36f8d199898
Reviewed-on: https://go-review.googlesource.com/70933
Reviewed-by: Emmanuel Odeke &lt;emm.odeke@gmail.com&gt;
Run-TryBot: Emmanuel Odeke &lt;emm.odeke@gmail.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bytes: add example for Len function of Reader</title>
<updated>2017-09-17T00:02:19+00:00</updated>
<author>
<name>Andrzej Żeżel</name>
<email>andrii.zhezhel@gmail.com</email>
</author>
<published>2017-09-16T14:58:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=de25b12d9f1aeea5fda59d98fb1084aeda2967a1'/>
<id>de25b12d9f1aeea5fda59d98fb1084aeda2967a1</id>
<content type='text'>
Change-Id: If7ecdc57f190f647bfc673bde8e66b4ef12aa906
Reviewed-on: https://go-review.googlesource.com/64190
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: If7ecdc57f190f647bfc673bde8e66b4ef12aa906
Reviewed-on: https://go-review.googlesource.com/64190
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bytes: Add missing examples to functions</title>
<updated>2017-08-25T20:50:58+00:00</updated>
<author>
<name>Borja Clemente</name>
<email>borja.clemente@gmail.com</email>
</author>
<published>2017-08-23T13:51:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=394f6a5ac0f945061483b715ba3fb1f6ccef2806'/>
<id>394f6a5ac0f945061483b715ba3fb1f6ccef2806</id>
<content type='text'>
Fixes #21570

Change-Id: Ia0734929a04fbce8fdd5fbcb1b7baff9a8bbe39e
Reviewed-on: https://go-review.googlesource.com/58030
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
Reviewed-by: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
Run-TryBot: Robert Griesemer &lt;gri@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #21570

Change-Id: Ia0734929a04fbce8fdd5fbcb1b7baff9a8bbe39e
Reviewed-on: https://go-review.googlesource.com/58030
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
Reviewed-by: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
Run-TryBot: Robert Griesemer &lt;gri@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
