1
0
mirror of https://github.com/golang/go synced 2024-11-20 10:24:40 -07:00

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>
This commit is contained in:
Mayank Kumar 2017-09-08 01:04:28 -07:00 committed by Ian Lance Taylor
parent ab40107708
commit a323656bb3

View 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
// /
// .
}