paths

package
v0.0.0-...-7dacf16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(path string) (string, error)

Abs returns an absolute representation of path. If the path is not absolute it will be joined with the current working directory to turn it into an absolute path. Abs calls Clean on the result. Abs also resolves user home directories and environment variables.

func Exists

func Exists(name string) (bool, error)

Exists reports whether a file exists in the given path.

func ExpandEnv

func ExpandEnv(path string) string

ExpandEnv replaces ${var} or $var in the string according to the values of the current environment variables. References to undefined variables are replaced by the empty string.

func ExpandUser

func ExpandUser(path string) (string, error)

ExpandUser tries to replace "~" or "~username" in the string to match the correspending user's home directory. If the wanted user does not exist, this function returns an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL