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 5package filepathlite 6 7import ( 8 "internal/bytealg" 9 "internal/stringslite" 10) 11 12const ( 13 Separator = '/' // OS-specific path separator 14 ListSeparator = '\000' // OS-specific path list separator 15) 16 17func IsPathSeparator(c uint8) bool { 18 return Separator == c 19} 20 21func isLocal(path string) bool { 22 return unixIsLocal(path) 23} 24 25func localize(path string) (string, error) { 26 if path[0] == '#' || bytealg.IndexByteString(path, 0) >= 0 { 27 return "", errInvalidPath 28 } 29 return path, nil 30} 31 32// IsAbs reports whether the path is absolute. 33func IsAbs(path string) bool { 34 return stringslite.HasPrefix(path, "/") || stringslite.HasPrefix(path, "#") 35} 36 37// volumeNameLen returns length of the leading volume name on Windows. 38// It returns 0 elsewhere. 39func volumeNameLen(path string) int { 40 return 0 41} 42