2011-03-24 23:46:17 +00:00
|
|
|
// Copyright 2010 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.
|
|
|
|
|
2012-01-13 05:11:45 +00:00
|
|
|
// +build darwin freebsd linux netbsd openbsd
|
2011-10-26 23:57:58 +00:00
|
|
|
|
2011-03-24 23:46:17 +00:00
|
|
|
package filepath
|
|
|
|
|
|
|
|
import "strings"
|
|
|
|
|
|
|
|
// IsAbs returns true if the path is absolute.
|
|
|
|
func IsAbs(path string) bool {
|
|
|
|
return strings.HasPrefix(path, "/")
|
|
|
|
}
|
|
|
|
|
2011-09-16 15:47:21 +00:00
|
|
|
// VolumeName returns the leading volume name on Windows.
|
2011-04-07 17:09:10 +00:00
|
|
|
// It returns "" elsewhere.
|
2011-09-16 15:47:21 +00:00
|
|
|
func VolumeName(path string) string {
|
2011-03-24 23:46:17 +00:00
|
|
|
return ""
|
|
|
|
}
|
2011-09-16 15:47:21 +00:00
|
|
|
|
2012-03-06 17:57:23 +00:00
|
|
|
// HasPrefix exists for historical compatibility and should not be used.
|
2011-09-16 15:47:21 +00:00
|
|
|
func HasPrefix(p, prefix string) bool {
|
|
|
|
return strings.HasPrefix(p, prefix)
|
|
|
|
}
|