]> Cypherpunks repositories - gostls13.git/commitdiff
path: add path.Dir example with trailing slash
authorMayank Kumar <krmayankk@gmail.com>
Fri, 8 Sep 2017 08:04:28 +0000 (01:04 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 8 Sep 2017 10:59:58 +0000 (10:59 +0000)
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>
src/path/example_test.go

index 07f9de3271c3c9de23a753271e6fe6642ef52e3b..d962e3d3319f1bc34028d57fa9e06d8aa25dc5b7 100644 (file)
@@ -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
        // /
        // .
 }