7aba0ab5b9bb2e09488612c8236a91859c0157ef
[platform/upstream/gcc.git] / libgo / go / path / filepath / path_unix.go
1 // Copyright 2010 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris
6
7 package filepath
8
9 import "strings"
10
11 // IsAbs returns true if the path is absolute.
12 func IsAbs(path string) bool {
13         return strings.HasPrefix(path, "/")
14 }
15
16 // volumeNameLen returns length of the leading volume name on Windows.
17 // It returns 0 elsewhere.
18 func volumeNameLen(path string) int {
19         return 0
20 }
21
22 // HasPrefix exists for historical compatibility and should not be used.
23 func HasPrefix(p, prefix string) bool {
24         return strings.HasPrefix(p, prefix)
25 }
26
27 func splitList(path string) []string {
28         if path == "" {
29                 return []string{}
30         }
31         return strings.Split(path, string(ListSeparator))
32 }