Documentation ¶
Overview ¶
Package env provides paths on different platforms.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppPath ¶
func AppPath(opt ...PathOption) (string, error)
AppPath returns path for a files or directory in an app support directory.
darwin: env.AppPath(env.Dir("MyApp"), env.File("test.txt"), env.Mkdir())
=> "~/Library/Application Support/MyApp/test.txt"
windows: env.AppPath(env.Dir("MyApp"), env.File("test.txt"), env.Mkdir())
=> "%LOCALAPPDATA%/MyApp/test.txt"
linux: env.AppPath(env.Dir("MyApp"), env.File("test.txt"), env.Mkdir())
=> "~/.local/share/MyApp/test.txt"
func HomeDir ¶
HomeDir returns current user home directory. On linux, when running an AppImage, HomeDir can be empty string.
func LogsPath ¶
func LogsPath(opt ...PathOption) (string, error)
LogsPath returns directory for app files.
func MustAppPath ¶
func MustAppPath(opt ...PathOption) string
MustAppPath returns AppPath or panics.
func PathExists ¶
PathExists returns true if path exists.
Types ¶
Click to show internal directories.
Click to hide internal directories.