Imports #
"internal/bytealg"
"internal/stringslite"
"syscall"
"errors"
"internal/stringslite"
"io/fs"
"slices"
"internal/bytealg"
"internal/stringslite"
"internal/bytealg"
"internal/stringslite"
"internal/bytealg"
"internal/stringslite"
"syscall"
"errors"
"internal/stringslite"
"io/fs"
"slices"
"internal/bytealg"
"internal/stringslite"
"internal/bytealg"
"internal/stringslite"
const ListSeparator = ';'
const ListSeparator = '\000'
const ListSeparator = ':'
const Separator = '\\'
const Separator = '/'
const Separator = '/'
var errInvalidPath = *ast.CallExpr
A lazybuf is a lazily constructed path buffer. It supports append, reading previously appended bytes, and retrieving the final string. It does not allocate a buffer to hold the output until that output diverges from s.
type lazybuf struct {
path string
buf []byte
w int
volAndPath string
volLen int
}
Base is filepath.Base.
func Base(path string) string
Clean is filepath.Clean.
func Clean(path string) string
Dir is filepath.Dir.
func Dir(path string) string
Ext is filepath.Ext.
func Ext(path string) string
FromSlash is filepath.ToSlash.
func FromSlash(path string) string
IsAbs reports whether the path is absolute.
func IsAbs(path string) bool
IsAbs reports whether the path is absolute.
func IsAbs(path string) (b bool)
IsAbs reports whether the path is absolute.
func IsAbs(path string) bool
IsLocal is filepath.IsLocal.
func IsLocal(path string) bool
func IsPathSeparator(c uint8) bool
func IsPathSeparator(c uint8) bool
func IsPathSeparator(c uint8) bool
Localize is filepath.Localize.
func Localize(path string) (string, error)
Split is filepath.Split.
func Split(path string) (dir string, file string)
ToSlash is filepath.ToSlash.
func ToSlash(path string) string
VolumeName is filepath.VolumeName.
func VolumeName(path string) string
VolumeNameLen returns the length of the leading volume name on Windows. It returns 0 elsewhere.
func VolumeNameLen(path string) int
func (b *lazybuf) append(c byte)
cutPath slices path around the first path separator.
func cutPath(path string) (before string, after string, found bool)
func equalFold(a string, b string) bool
func (b *lazybuf) index(i int) byte
func isLocal(path string) bool
func isLocal(path string) bool
func isLocal(path string) bool
func isReservedBaseName(name string) bool
isReservedName reports if name is a Windows reserved device name. It does not detect names with an extension, which are also reserved on some Windows versions. For details, search for PRN in https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file.
func isReservedName(name string) bool
isUNC reports whether path is a UNC path.
func isUNC(path string) bool
func localize(path string) (string, error)
func localize(path string) (string, error)
func localize(path string) (string, error)
pathHasPrefixFold tests whether the path s begins with prefix, ignoring case and treating all path separators as equivalent. If s is longer than prefix, then s[len(prefix)] must be a path separator.
func pathHasPrefixFold(s string, prefix string) bool
postClean adjusts the results of Clean to avoid turning a relative path into an absolute or rooted one.
func postClean(out *lazybuf)
func postClean(out *lazybuf)
func (b *lazybuf) prepend(prefix ...byte)
func replaceStringByte(s string, old byte, new byte) string
func (b *lazybuf) string() string
func toUpper(c byte) byte
uncLen returns the length of the volume prefix of a UNC path. prefixLen is the prefix prior to the start of the UNC host; for example, for "//host/share", the prefixLen is len("//")==2.
func uncLen(path string, prefixLen int) int
func unixIsLocal(path string) bool
volumeNameLen returns length of the leading volume name on Windows. It returns 0 elsewhere.
func volumeNameLen(path string) int
volumeNameLen returns length of the leading volume name on Windows. It returns 0 elsewhere. See: https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats https://googleprojectzero.blogspot.com/2016/02/the-definitive-guide-on-win32-to-nt.html
func volumeNameLen(path string) int
volumeNameLen returns length of the leading volume name on Windows. It returns 0 elsewhere.
func volumeNameLen(path string) int
Generated with Arrow