<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/go-git.git/src/strings/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>strings: clarify usage of Title and ToTitle</title>
<updated>2019-07-30T02:52:57+00:00</updated>
<author>
<name>Andrew Todd</name>
<email>andrew.todd@wework.com</email>
</author>
<published>2019-07-27T23:20:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=fbb819ebc443518e9caea3c1b0d0f9e0efec2262'/>
<id>fbb819ebc443518e9caea3c1b0d0f9e0efec2262</id>
<content type='text'>
This is intended to help clear up confusion around the usage of the
Title and ToTitle functions. It includes a link to define title case
to distinguish it from upper case. It also includes an additional
example for the ToTitle function to showcase the difference in behavior
between it and the Title function.

Fixes #33302

Change-Id: I44e62962fb04d0d22966a39eda3a2d16de7a2291
Reviewed-on: https://go-review.googlesource.com/c/go/+/187825
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is intended to help clear up confusion around the usage of the
Title and ToTitle functions. It includes a link to define title case
to distinguish it from upper case. It also includes an additional
example for the ToTitle function to showcase the difference in behavior
between it and the Title function.

Fixes #33302

Change-Id: I44e62962fb04d0d22966a39eda3a2d16de7a2291
Reviewed-on: https://go-review.googlesource.com/c/go/+/187825
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>strings: clarify example of ContainsAny</title>
<updated>2019-05-24T15:23:08+00:00</updated>
<author>
<name>Martin Sucha</name>
<email>anty.sk+git@gmail.com</email>
</author>
<published>2019-05-23T18:34:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=db3255536cdbdba9d6f38da9c3bb1faf55f63277'/>
<id>db3255536cdbdba9d6f38da9c3bb1faf55f63277</id>
<content type='text'>
I have seen code that literally copied the example like this:

    if strings.ContainsAny(s, "1 &amp; 2 &amp; 3") {

The developer apparently thought that this is the way to
specify multiple characters and I noticed this pattern
being used in the example. Let's update the example so
that it's clear how multiple Unicode code points should
be specified.

Change-Id: Id4d780555e521af62fb787a7950be1e60848cd95
Reviewed-on: https://go-review.googlesource.com/c/go/+/178737
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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I have seen code that literally copied the example like this:

    if strings.ContainsAny(s, "1 &amp; 2 &amp; 3") {

The developer apparently thought that this is the way to
specify multiple characters and I noticed this pattern
being used in the example. Let's update the example so
that it's clear how multiple Unicode code points should
be specified.

Change-Id: Id4d780555e521af62fb787a7950be1e60848cd95
Reviewed-on: https://go-review.googlesource.com/c/go/+/178737
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>strings: add ReplaceAll example</title>
<updated>2018-12-13T00:35:06+00:00</updated>
<author>
<name>dupoxy</name>
<email>dupoxy@users.noreply.github.com</email>
</author>
<published>2018-12-12T22:49:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=09da2801578519ee5597bdd4cbfa22d4d127cc6d'/>
<id>09da2801578519ee5597bdd4cbfa22d4d127cc6d</id>
<content type='text'>
Change-Id: I6b0d470bdedb92844943c8e5823e214d6a7471cf
GitHub-Last-Rev: 4a135000ba9c23a588b960e5b2989710cc71e3e2
GitHub-Pull-Request: golang/go#29199
Reviewed-on: https://go-review.googlesource.com/c/153840
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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I6b0d470bdedb92844943c8e5823e214d6a7471cf
GitHub-Last-Rev: 4a135000ba9c23a588b960e5b2989710cc71e3e2
GitHub-Pull-Request: golang/go#29199
Reviewed-on: https://go-review.googlesource.com/c/153840
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>strings: revert accidental example change from CL 153840</title>
<updated>2018-12-13T00:22:51+00:00</updated>
<author>
<name>Brad Fitzpatrick</name>
<email>bradfitz@golang.org</email>
</author>
<published>2018-12-12T22:28:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=e123ccbfe0856da67446374d39e9d3e738046e9e'/>
<id>e123ccbfe0856da67446374d39e9d3e738046e9e</id>
<content type='text'>
Change-Id: I2ff29aa9909be3062fcd5f65af261f5d8c46fbc1
Reviewed-on: https://go-review.googlesource.com/c/153843
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: I2ff29aa9909be3062fcd5f65af261f5d8c46fbc1
Reviewed-on: https://go-review.googlesource.com/c/153843
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>all: use strings.ReplaceAll and bytes.ReplaceAll where applicable</title>
<updated>2018-09-26T22:14:25+00:00</updated>
<author>
<name>Brad Fitzpatrick</name>
<email>bradfitz@golang.org</email>
</author>
<published>2018-09-26T21:10:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=da0d1a44bac379f5acedb1933f85400de08f4ac6'/>
<id>da0d1a44bac379f5acedb1933f85400de08f4ac6</id>
<content type='text'>
I omitted vendor directories and anything necessary for bootstrapping.
(Tested by bootstrapping with Go 1.4)

Updates #27864

Change-Id: I7d9b68d0372d3a34dee22966cca323513ece7e8a
Reviewed-on: https://go-review.googlesource.com/137856
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@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>
I omitted vendor directories and anything necessary for bootstrapping.
(Tested by bootstrapping with Go 1.4)

Updates #27864

Change-Id: I7d9b68d0372d3a34dee22966cca323513ece7e8a
Reviewed-on: https://go-review.googlesource.com/137856
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@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>strings: add Builder</title>
<updated>2017-11-06T18:23:51+00:00</updated>
<author>
<name>Caleb Spare</name>
<email>cespare@gmail.com</email>
</author>
<published>2017-10-31T23:51:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=37b056948d058679efa4e87fb6c9b2a2ddfa31a3'/>
<id>37b056948d058679efa4e87fb6c9b2a2ddfa31a3</id>
<content type='text'>
This is like a write-only subset of bytes.Buffer with an
allocation-free String method.

Fixes #18990.

Change-Id: Icdf7240f4309a52924dc3af04a39ecd737a210f4
Reviewed-on: https://go-review.googlesource.com/74931
Run-TryBot: Caleb Spare &lt;cespare@gmail.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@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>
This is like a write-only subset of bytes.Buffer with an
allocation-free String method.

Fixes #18990.

Change-Id: Icdf7240f4309a52924dc3af04a39ecd737a210f4
Reviewed-on: https://go-review.googlesource.com/74931
Run-TryBot: Caleb Spare &lt;cespare@gmail.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>strings: add examples for specialCase</title>
<updated>2017-10-31T14:09:07+00:00</updated>
<author>
<name>Ramazan AYYILDIZ</name>
<email>rayyildiz@gmail.com</email>
</author>
<published>2017-10-31T10:19:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=bc98cea9418b8d3bec037ac16a46639576af9c06'/>
<id>bc98cea9418b8d3bec037ac16a46639576af9c06</id>
<content type='text'>
Change-Id: Ifa0384722dd879af7f5edb7b7aaac5ede3cff46d
Reviewed-on: https://go-review.googlesource.com/74690
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: Ifa0384722dd879af7f5edb7b7aaac5ede3cff46d
Reviewed-on: https://go-review.googlesource.com/74690
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>strings: add examples for Index functions</title>
<updated>2017-08-09T04:43:33+00:00</updated>
<author>
<name>molivier</name>
<email>olivier.matthieu@gmail.com</email>
</author>
<published>2017-08-08T15:39:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=8fb9cee3f1a6333ad50d7ca382e9a0bdafc1b5b6'/>
<id>8fb9cee3f1a6333ad50d7ca382e9a0bdafc1b5b6</id>
<content type='text'>
Change-Id: Ia0f0c8ab4f2f9e96faad6d88775ae19ca7fae53c
Reviewed-on: https://go-review.googlesource.com/53790
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: Avelino &lt;t@avelino.xxx&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: Ia0f0c8ab4f2f9e96faad6d88775ae19ca7fae53c
Reviewed-on: https://go-review.googlesource.com/53790
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: Avelino &lt;t@avelino.xxx&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>strings: add Examples for TrimFunc and variants during Gophercon!</title>
<updated>2017-08-08T14:26:13+00:00</updated>
<author>
<name>Lyle Franklin</name>
<email>lylejfranklin@gmail.com</email>
</author>
<published>2017-07-15T20:33:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=a35377515f6a232305a52f89c164d2782951bc11'/>
<id>a35377515f6a232305a52f89c164d2782951bc11</id>
<content type='text'>
Change-Id: I6bfe5b914cf11be1cd1f8e61d557cc718725f0be
Reviewed-on: https://go-review.googlesource.com/49013
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: I6bfe5b914cf11be1cd1f8e61d557cc718725f0be
Reviewed-on: https://go-review.googlesource.com/49013
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>strings: add a example for TrimFunc</title>
<updated>2017-07-15T21:14:22+00:00</updated>
<author>
<name>Francisco Rojas</name>
<email>francisco.rojas.gallegos@gmail.com</email>
</author>
<published>2017-07-15T20:51:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=b119ef154c1cc3bded16baff06143844bf1b28e1'/>
<id>b119ef154c1cc3bded16baff06143844bf1b28e1</id>
<content type='text'>
Change-Id: I9c0c601ec5957475e949dcc4a8c2116724d01215
Reviewed-on: https://go-review.googlesource.com/48961
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I9c0c601ec5957475e949dcc4a8c2116724d01215
Reviewed-on: https://go-review.googlesource.com/48961
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
