<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/go-git.git/src/path/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>path,path/filepath: add Join examples with ".." components</title>
<updated>2020-08-19T00:10:22+00:00</updated>
<author>
<name>Andrew Ekstedt</name>
<email>andrew.ekstedt@gmail.com</email>
</author>
<published>2020-07-24T19:48:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=98a0071a5363e307c2e284034f810378de3883dd'/>
<id>98a0071a5363e307c2e284034f810378de3883dd</id>
<content type='text'>
People sometimes expect Join to trim .. components from its arguments
before joining, and are surprised that it doesn't. This is bad if they
were relying on that assumed behaviour to prevent directory traversal
attacks.

While a careful reading of the documentation for Join and Clean
might dispel this notion, it is not obvious at first glance.

Add a case to the examples to nudge people in the right direction.

Updates #40373

Change-Id: Ib5792c12ba1000811a0c0eb77048196d0b26da60
Reviewed-on: https://go-review.googlesource.com/c/go/+/249177
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
People sometimes expect Join to trim .. components from its arguments
before joining, and are surprised that it doesn't. This is bad if they
were relying on that assumed behaviour to prevent directory traversal
attacks.

While a careful reading of the documentation for Join and Clean
might dispel this notion, it is not obvious at first glance.

Add a case to the examples to nudge people in the right direction.

Updates #40373

Change-Id: Ib5792c12ba1000811a0c0eb77048196d0b26da60
Reviewed-on: https://go-review.googlesource.com/c/go/+/249177
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>path: change the output format of ExampleSplit function</title>
<updated>2019-09-01T10:08:36+00:00</updated>
<author>
<name>Irbe Krumina</name>
<email>irbekrm@gmail.com</email>
</author>
<published>2019-08-22T19:55:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=54a9c16533b5607f1eb035815b97fb13fd36ee34'/>
<id>54a9c16533b5607f1eb035815b97fb13fd36ee34</id>
<content type='text'>
At the moment the last output line of ExampleSplit- two empty strings- are being
trimmed from the output.  I have formatted the output of the function to avoid
whitespace trimming and show empty strings more clearly.

Fixes #23542

Change-Id: Ic2a4d98cfa06db1466c6c6d98099542df9e7c88b
Reviewed-on: https://go-review.googlesource.com/c/go/+/191397
Run-TryBot: Daniel Martí &lt;mvdan@mvdan.cc&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
Reviewed-by: Daniel Martí &lt;mvdan@mvdan.cc&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
At the moment the last output line of ExampleSplit- two empty strings- are being
trimmed from the output.  I have formatted the output of the function to avoid
whitespace trimming and show empty strings more clearly.

Fixes #23542

Change-Id: Ic2a4d98cfa06db1466c6c6d98099542df9e7c88b
Reviewed-on: https://go-review.googlesource.com/c/go/+/191397
Run-TryBot: Daniel Martí &lt;mvdan@mvdan.cc&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
Reviewed-by: Daniel Martí &lt;mvdan@mvdan.cc&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>path: add example for Match</title>
<updated>2018-02-13T18:45:33+00:00</updated>
<author>
<name>Jeff Dupont</name>
<email>jeff.dupont@gmail.com</email>
</author>
<published>2017-07-27T03:27:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=d691a31ec1f8cd7a38a781714a82d55dcaf8eb6c'/>
<id>d691a31ec1f8cd7a38a781714a82d55dcaf8eb6c</id>
<content type='text'>
Change-Id: I5ab475011e9200c5055809e658d14c04c0a07a8a
Reviewed-on: https://go-review.googlesource.com/51413
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I5ab475011e9200c5055809e658d14c04c0a07a8a
Reviewed-on: https://go-review.googlesource.com/51413
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>path: add path.Dir example with trailing slash</title>
<updated>2017-09-08T10:59:58+00:00</updated>
<author>
<name>Mayank Kumar</name>
<email>krmayankk@gmail.com</email>
</author>
<published>2017-09-08T08:04:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=a323656bb3edce6b2913a4946be8481ef1311afc'/>
<id>a323656bb3edce6b2913a4946be8481ef1311afc</id>
<content type='text'>
Change-Id: I143203a9dcf9a4da0e53a3aab6e370244b849296
Reviewed-on: https://go-review.googlesource.com/62270
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: I143203a9dcf9a4da0e53a3aab6e370244b849296
Reviewed-on: https://go-review.googlesource.com/62270
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>path: add examples</title>
<updated>2017-05-16T15:44:29+00:00</updated>
<author>
<name>Mark Harrison</name>
<email>marhar@google.com</email>
</author>
<published>2017-05-09T05:48:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=84a51432a80686267e131f5d516559b3d82122b8'/>
<id>84a51432a80686267e131f5d516559b3d82122b8</id>
<content type='text'>
This change adds several examples, with emphasis on special or edge
cases such as a directory parameter consisting of an empty string.

Change-Id: Ib4ac3d0f6d503493eeed0c4fda7c12acf782e9e2
Reviewed-on: https://go-review.googlesource.com/43010
Reviewed-by: Steve Francia &lt;spf@golang.org&gt;
Run-TryBot: Jaana Burcu Dogan &lt;jbd@google.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change adds several examples, with emphasis on special or edge
cases such as a directory parameter consisting of an empty string.

Change-Id: Ib4ac3d0f6d503493eeed0c4fda7c12acf782e9e2
Reviewed-on: https://go-review.googlesource.com/43010
Reviewed-by: Steve Francia &lt;spf@golang.org&gt;
Run-TryBot: Jaana Burcu Dogan &lt;jbd@google.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>path, path/filepath: add Join example with joined rooted path</title>
<updated>2016-04-03T16:55:51+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2016-03-15T00:23:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=1f7e55e418659dc3b5fe66792b85807a7065144f'/>
<id>1f7e55e418659dc3b5fe66792b85807a7065144f</id>
<content type='text'>
This makes clear that Go's path.Join and filepath.Join are different
from the Python os.path.join (and perhaps others).

Requested in private mail.

Change-Id: Ie5dfad8a57f9baa5cca31246af1fd4dd5b1a64ee
Reviewed-on: https://go-review.googlesource.com/20711
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes clear that Go's path.Join and filepath.Join are different
from the Python os.path.join (and perhaps others).

Requested in private mail.

Change-Id: Ie5dfad8a57f9baa5cca31246af1fd4dd5b1a64ee
Reviewed-on: https://go-review.googlesource.com/20711
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>build: move package sources from src/pkg to src</title>
<updated>2014-09-08T04:08:51+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2014-09-08T04:08:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=c007ce824d9a4fccb148f9204e04c23ed2984b71'/>
<id>c007ce824d9a4fccb148f9204e04c23ed2984b71</id>
<content type='text'>
Preparation was in CL 134570043.
This CL contains only the effect of 'hg mv src/pkg/* src'.
For more about the move, see golang.org/s/go14nopkg.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Preparation was in CL 134570043.
This CL contains only the effect of 'hg mv src/pkg/* src'.
For more about the move, see golang.org/s/go14nopkg.
</pre>
</div>
</content>
</entry>
</feed>
