Help us shape the future of Go! Take the 2026 Go Developer Survey

pathutil

package
v0.66.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandHome

func ExpandHome(path string) string

ExpandHome expands a leading ~ to the user's home directory. Only expands "~" or "~/..." -- not "~username/..." forms. A path whose home cannot be resolved is returned unchanged.

func ExpandHomeE added in v0.60.0

func ExpandHomeE(path string) (string, error)

ExpandHomeE is ExpandHome for callers that must report an unresolvable home directory instead of using the literal path. The error is the one os.UserHomeDir returned, unwrapped, so callers phrase it themselves.

func XDGConfigHome added in v0.60.0

func XDGConfigHome() string

XDGConfigHome returns $XDG_CONFIG_HOME, or ~/.config when it is unset.

func XDGDataHome added in v0.60.0

func XDGDataHome() string

XDGDataHome returns $XDG_DATA_HOME, or ~/.local/share when it is unset.

Types

This section is empty.

Jump to

Keyboard shortcuts

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