diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2015-10-31 00:59:47 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2015-10-31 00:59:47 +0000 |
commit | af146490bb04205107cb23e301ec7a8ff927b5fc (patch) | |
tree | 13beeaed3698c61903fe93fb1ce70bd9b18d4e7f /libgo/go/path/filepath/example_unix_test.go | |
parent | 725e1be3406315d9bcc8195d7eef0a7082b3c7cc (diff) |
runtime: Remove now unnecessary pad field from ParFor.
It is not needed due to the removal of the ctx field.
Reviewed-on: https://go-review.googlesource.com/16525
From-SVN: r229616
Diffstat (limited to 'libgo/go/path/filepath/example_unix_test.go')
-rw-r--r-- | libgo/go/path/filepath/example_unix_test.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libgo/go/path/filepath/example_unix_test.go b/libgo/go/path/filepath/example_unix_test.go index f3fe076c3c7..27d85d15c6c 100644 --- a/libgo/go/path/filepath/example_unix_test.go +++ b/libgo/go/path/filepath/example_unix_test.go @@ -37,3 +37,31 @@ func ExampleRel() { // "/b/c": "../b/c" <nil> // "./b/c": "" Rel: can't make b/c relative to /a } + +func ExampleSplit() { + paths := []string{ + "/home/arnie/amelia.jpg", + "/mnt/photos/", + "rabbit.jpg", + "/usr/local//go", + } + fmt.Println("On Unix:") + for _, p := range paths { + dir, file := filepath.Split(p) + fmt.Printf("input: %q\n\tdir: %q\n\tfile: %q\n", p, dir, file) + } + // Output: + // On Unix: + // input: "/home/arnie/amelia.jpg" + // dir: "/home/arnie/" + // file: "amelia.jpg" + // input: "/mnt/photos/" + // dir: "/mnt/photos/" + // file: "" + // input: "rabbit.jpg" + // dir: "" + // file: "rabbit.jpg" + // input: "/usr/local//go" + // dir: "/usr/local//" + // file: "go" +} |