Documentation
¶
Index ¶
- func Abs(p string) (string, error)
- func Base(p string) string
- func Clean(p string) string
- func Dir(p string) string
- func HasPathPrefix(path, prefixCore string) bool
- func IsAbsolute(p string) bool
- func IsAbsoluteOrSpecial(p string) bool
- func IsInteger(n float64) bool
- func IsSpecial(p string) bool
- func Join(elem ...string) string
- func Match(pattern, name string) (bool, error)
- func RecoverPanic(context string)
- func Rel(basepath, targpath string) (string, error)
- func SplitList(s string) []string
- func TrimPathPrefix(path, prefixCore string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Abs ¶
Abs returns an absolute representation of path. If the path is not absolute it is joined with the current working directory.
func Clean ¶
Clean returns the shortest path equivalent to p, removing . and .. elements. All paths use forward slashes.
func HasPathPrefix ¶
HasPathPrefix checks if path starts with a special prefix. prefixCore should be "EMBED" or "STORE" (without slashes).
func IsAbsolute ¶
IsAbsolute reports whether the path is absolute. A path is absolute if it starts with "/".
func IsAbsoluteOrSpecial ¶
IsAbsoluteOrSpecial reports whether the path is absolute or starts with a special prefix.
func IsSpecial ¶
IsSpecial reports whether the path starts with a special prefix like /EMBED/, /STORE/, /HERE/, or /CWD/.
- /EMBED/ — embedded read-only filesystem
- /STORE/ — datastore-backed virtual filesystem
- /HERE/ — directory of the currently executing script frame
- /CWD/ — process working directory
func Match ¶
Match reports whether name matches the shell pattern. Pattern uses forward slashes and supports * and ? wildcards.
func RecoverPanic ¶
func RecoverPanic(context string)
RecoverPanic recovers from panics in goroutines and logs them safely. It prints the panic message, stack trace, and goroutine info to stderr. This should be called at the beginning of any goroutine function:
go func() {
defer RecoverPanic("goroutine description")
// actual work
}()
func Rel ¶
Rel returns a relative path that is lexicographically equivalent to targpath when joined to basepath. Returns an error if both paths cannot be made relative to each other.
func SplitList ¶
SplitList splits a path list separated by colons (Unix-style). This is used for environment variables like DUSO_LIB. We always use colon separation internally, even on Windows.
func TrimPathPrefix ¶
TrimPathPrefix removes a special prefix from path. prefixCore should be "EMBED" or "STORE" (without slashes).
Types ¶
This section is empty.