github.com/twelsh-aw/go/src@v0.0.0-20230516233729-a56fe86a7c81/path/filepath/path_plan9.go (about) 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 package filepath 6 7 import "strings" 8 9 func isLocal(path string) bool { 10 return unixIsLocal(path) 11 } 12 13 // IsAbs reports whether the path is absolute. 14 func IsAbs(path string) bool { 15 return strings.HasPrefix(path, "/") || strings.HasPrefix(path, "#") 16 } 17 18 // volumeNameLen returns length of the leading volume name on Windows. 19 // It returns 0 elsewhere. 20 func volumeNameLen(path string) int { 21 return 0 22 } 23 24 // HasPrefix exists for historical compatibility and should not be used. 25 // 26 // Deprecated: HasPrefix does not respect path boundaries and 27 // does not ignore case when required. 28 func HasPrefix(p, prefix string) bool { 29 return strings.HasPrefix(p, prefix) 30 } 31 32 func splitList(path string) []string { 33 if path == "" { 34 return []string{} 35 } 36 return strings.Split(path, string(ListSeparator)) 37 } 38 39 func abs(path string) (string, error) { 40 return unixAbs(path) 41 } 42 43 func join(elem []string) string { 44 // If there's a bug here, fix the logic in ./path_unix.go too. 45 for i, e := range elem { 46 if e != "" { 47 return Clean(strings.Join(elem[i:], string(Separator))) 48 } 49 } 50 return "" 51 } 52 53 func sameWord(a, b string) bool { 54 return a == b 55 }