| // Copyright 2013 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // +build !windows,!plan9 |
| func ExampleSplitList() { |
| fmt.Println("On Unix:", filepath.SplitList("/a/b/c:/usr/bin")) |
| // On Unix: [/a/b/c /usr/bin] |
| for _, p := range paths { |
| rel, err := filepath.Rel(base, p) |
| fmt.Printf("%q: %q %v\n", p, rel, err) |
| // "/b/c": "../b/c" <nil> |
| // "./b/c": "" Rel: can't make b/c relative to /a |
| "/home/arnie/amelia.jpg", |
| for _, p := range paths { |
| dir, file := filepath.Split(p) |
| fmt.Printf("input: %q\n\tdir: %q\n\tfile: %q\n", p, dir, file) |
| // input: "/home/arnie/amelia.jpg" |
| // input: "/usr/local//go" |