From a323656bb3edce6b2913a4946be8481ef1311afc Mon Sep 17 00:00:00 2001 From: Mayank Kumar Date: Fri, 8 Sep 2017 01:04:28 -0700 Subject: [PATCH] path: add path.Dir example with trailing slash Change-Id: I143203a9dcf9a4da0e53a3aab6e370244b849296 Reviewed-on: https://go-review.googlesource.com/62270 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/path/example_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/path/example_test.go b/src/path/example_test.go index 07f9de3271c3c..d962e3d3319f1 100644 --- a/src/path/example_test.go +++ b/src/path/example_test.go @@ -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 // / // . }