unix

package
v0.0.0-...-b0c018a Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Home

func Home() string

Home returns the home directory for the current process, with the following preference order:

  • The value of the HOME environment variable, if it is set and contains an absolute path.
  • The home directory indicated in the return value of the "Current" function in the os/user standard library package, which has platform-specific behavior, if it contains an absolute path.
  • If neither of the above yields an absolute path, the string "/".

In practice, POSIX requires the HOME environment variable to be set, so on any reasonable system it is that which will be selected. The other permutations are fallback behavior for less reasonable systems.

XDG does not permit applications to write directly into the home directory. Instead, the paths returned by other functions in this package are potentially derived from the home path, if their explicit environment variables are not set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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