Documentation ¶
Index ¶
- func Abs(path string) (abs string, err error)
- func Basename(path string, ext string) string
- func CreateEmptyFile(path string) (err error)
- func CreateEmptyFileIfNotExists(path string) (err error)
- func CygwinizePath(path string) string
- func Dir(path string) string
- func ErrorIf(condition bool, message string) error
- func EvalSymlinks(path string) (string, error)
- func Executable() (exe string)
- func Filename(path string) string
- func FilterDirectories(paths []string) []string
- func Get[E comparable](v E, fallbacks ...E) E
- func GetCygwinAwareHomeDir() string
- func GetIndex[S ~[]E, E any](s S, index int, fallback E) E
- func GetShellHomeDir() string
- func GetTerminalType() string
- func GetUserHomeDir() string
- func Getwd() string
- func Join(paths ...string) string
- func OpenFileInDefaultApp(path string) (err error)
- func PanicIfError(err error)
- func PanicIfFalse(condition bool, message string)
- func PanicIfPathDoesNotExist(path string)
- func PanicIfPathExists(path string)
- func PanicIfTrue(condition bool, message string)
- func PathExists(filename string) bool
- func PathIsDir(filename string) bool
- func PathIsFile(filename string) bool
- func Rel(basepath string, targpath string) (string, error)
- func SafeWriteTemplateToFile(t *template.Template, path string, vars map[string]interface{}) (err error)
- func SortKeys[M ~map[K]V, K cmp.Ordered, V any](m M) []K
- func Ternary[T any](cond bool, a T, b T) T
- func ToSlash(path string) string
- func WriteTemplateToFile(tmpl *template.Template, path string, vars map[string]interface{}) (err error)
- func WriteTemplateToString(tmpl *template.Template, vars map[string]interface{}) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEmptyFile ¶
func CreateEmptyFileIfNotExists ¶ added in v2.0.28
func CygwinizePath ¶ added in v2.0.28
func EvalSymlinks ¶ added in v2.0.31
func Executable ¶
func Executable() (exe string)
func FilterDirectories ¶
func Get ¶
func Get[E comparable](v E, fallbacks ...E) E
func GetCygwinAwareHomeDir ¶ added in v2.0.32
func GetCygwinAwareHomeDir() string
GetCygpathHomeDir returns the user's ~/ dir from the cygpath command. If cygpath doesn't exist (either not on Windows or Cygwin is not installed) then the normal $USERPROFILE or /Users/<username> is returned. This method is only used to determine the location of the user's rc file for setup, in all other cases the user's home dir is the normal one. Note: on windows in powershell, this resolves to the cygwin home dir (unexpectedly)
func GetShellHomeDir ¶ added in v2.0.32
func GetShellHomeDir() string
func GetTerminalType ¶ added in v2.0.31
func GetTerminalType() string
func GetUserHomeDir ¶ added in v2.0.25
func GetUserHomeDir() string
func OpenFileInDefaultApp ¶ added in v2.0.28
func PanicIfError ¶
func PanicIfError(err error)
func PanicIfFalse ¶
func PanicIfPathDoesNotExist ¶
func PanicIfPathDoesNotExist(path string)
func PanicIfPathExists ¶
func PanicIfPathExists(path string)
func PanicIfTrue ¶
func PathExists ¶
func PathIsFile ¶
func SafeWriteTemplateToFile ¶ added in v2.0.28
func WriteTemplateToFile ¶ added in v2.0.28
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.