Skip to content

Commit

Permalink
path: add path.Dir example with trailing slash
Browse files Browse the repository at this point in the history
Change-Id: I143203a9dcf9a4da0e53a3aab6e370244b849296
Reviewed-on: https://go-review.googlesource.com/62270
Run-TryBot: Ian Lance Taylor <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
  • Loading branch information
krmayankk authored and ianlancetaylor committed Sep 8, 2017
1 parent ab40107 commit a323656
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/path/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
// /
// .
}
Expand Down

0 comments on commit a323656

Please sign in to comment.