Skip to content

Commit a323656

Browse files
krmayankkianlancetaylor
authored andcommitted
path: add path.Dir example with trailing slash
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]>
1 parent ab40107 commit a323656

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/path/example_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,15 @@ func ExampleClean() {
4747
func ExampleDir() {
4848
fmt.Println(path.Dir("/a/b/c"))
4949
fmt.Println(path.Dir("a/b/c"))
50+
fmt.Println(path.Dir("/a/"))
51+
fmt.Println(path.Dir("a/"))
5052
fmt.Println(path.Dir("/"))
5153
fmt.Println(path.Dir(""))
5254
// Output:
5355
// /a/b
5456
// a/b
57+
// /a
58+
// a
5559
// /
5660
// .
5761
}

0 commit comments

Comments
 (0)