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.
5 // +build darwin freebsd linux netbsd openbsd
11 // IsAbs returns true if the path is absolute.
12 func IsAbs(path string) bool {
13 return strings.HasPrefix(path, "/")
16 // VolumeName returns the leading volume name on Windows.
17 // It returns "" elsewhere.
18 func VolumeName(path string) string {
22 // HasPrefix exists for historical compatibility and should not be used.
23 func HasPrefix(p, prefix string) bool {
24 return strings.HasPrefix(p, prefix)