Documentation
¶
Index ¶
- Constants
- func ExpandPath(path string) (string, error)
- func MkExpandPath(path string) (string, error)
- func MustExpandPath(path string) string
- func Read(fsys fs.FS, globPattern string) ([]byte, error)
- func ReadJson[T any](path string) (T, error)
- func ReadJsonFs[T any](fsys fs.FS, path string) (T, error)
- func ReadString(fsys fs.FS, globPattern string) (string, error)
- func WriteJson(path string, v any) error
Constants ¶
View Source
const ( AppPathVar = "$" + sys.AppPath + "$" AppDocPathVar = "$" + sys.AppDocumentsPath + "$" AppCachePathVar = "$" + sys.AppCachePath + "$" )
Variables used in strings.
Variables ¶
This section is empty.
Functions ¶
func ExpandPath ¶
ExpandPath answers the path, resolving any sys variables.
func MkExpandPath ¶
MkExpandPath answers the path, resolving any sys variables and guaranteeing the parent dir exists. It assumes the leaf is a file. Variables: Anything defined in sys.
func MustExpandPath ¶
MustExpandPath answers the path, resolving any sys variables. It ignores any errors, which for some clients can't happen.
func ReadJsonFs ¶
ReadJsonFs reads the file and unmarshals to the type as JSON
func ReadString ¶
ReadString returns the first matching file as a string.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.