utils

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetEnv = func(key string) (string, bool) {
	return os.LookupEnv(key)
}

GetEnv is a wrapper around os.LookupEnv for easier testing

View Source
var LookupUser = func(username string) (*user.User, error) {
	return user.Lookup(username)
}

LookupUser is a wrapper around user.Lookup for easier testing

Functions

func ExpandHomeDirectory

func ExpandHomeDirectory(username, path string) (string, error)

ExpandHomeDirectory expands the tilde in the given path based on the provided username.

func GetUserEnvFunc

func GetUserEnvFunc(u *user.User) (func(string) string, error)

func GetUserIDs

func GetUserIDs(username string) (int, int, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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