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