mirror of
https://github.com/golang/go
synced 2024-11-20 07:54:39 -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:
parent
ab40107708
commit
a323656bb3
@ -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
|
||||
// /
|
||||
// .
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user