diff options
| author | Mayank Kumar <krmayankk@gmail.com> | 2017-09-08 01:04:28 -0700 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2017-09-08 10:59:58 +0000 |
| commit | a323656bb3edce6b2913a4946be8481ef1311afc (patch) | |
| tree | d1c93ddd653b467373247b2c17e477434ac2674d /src | |
| parent | ab40107708042ded6bdc1fb841c7cf2c2ab002ab (diff) | |
| download | go-a323656bb3edce6b2913a4946be8481ef1311afc.tar.xz | |
path: add path.Dir example with trailing slash
Change-Id: I143203a9dcf9a4da0e53a3aab6e370244b849296
Reviewed-on: https://go-review.googlesource.com/62270
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/path/example_test.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/path/example_test.go b/src/path/example_test.go index 07f9de3271..d962e3d331 100644 --- a/src/path/example_test.go +++ b/src/path/example_test.go @@ -47,11 +47,15 @@ func ExampleClean() { func ExampleDir() { fmt.Println(path.Dir("/a/b/c")) fmt.Println(path.Dir("a/b/c")) + fmt.Println(path.Dir("/a/")) + fmt.Println(path.Dir("a/")) fmt.Println(path.Dir("/")) fmt.Println(path.Dir("")) // Output: // /a/b // a/b + // /a + // a // / // . } |
