LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2010 The Go Authors. All rights reserved. | 1 // Copyright 2010 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
| 4 |
| 5 // +build darwin freebsd linux openbsd |
4 | 6 |
5 package filepath | 7 package filepath |
6 | 8 |
7 import "strings" | 9 import "strings" |
8 | 10 |
9 // IsAbs returns true if the path is absolute. | 11 // IsAbs returns true if the path is absolute. |
10 func IsAbs(path string) bool { | 12 func IsAbs(path string) bool { |
11 return strings.HasPrefix(path, "/") | 13 return strings.HasPrefix(path, "/") |
12 } | 14 } |
13 | 15 |
14 // VolumeName returns the leading volume name on Windows. | 16 // VolumeName returns the leading volume name on Windows. |
15 // It returns "" elsewhere. | 17 // It returns "" elsewhere. |
16 func VolumeName(path string) string { | 18 func VolumeName(path string) string { |
17 return "" | 19 return "" |
18 } | 20 } |
19 | 21 |
20 // HasPrefix tests whether the path p begins with prefix. | 22 // HasPrefix tests whether the path p begins with prefix. |
21 func HasPrefix(p, prefix string) bool { | 23 func HasPrefix(p, prefix string) bool { |
22 return strings.HasPrefix(p, prefix) | 24 return strings.HasPrefix(p, prefix) |
23 } | 25 } |
LEFT | RIGHT |