package xos
import "git.sr.ht/~jamesponddotco/xstd-go/xos"
Package xos provides extensions for Go's standard os package.
Index ¶
- func GetBoolEnv(key string, fallback bool) bool
- func GetDurationEnv(key string, fallback time.Duration) time.Duration
- func GetEnv(key, fallback string) string
- func GetIntEnv(key string, fallback int) int
Functions ¶
func GetBoolEnv ¶
GetBoolEnv returns the boolean value of the environment variable named by the key.
If the variable is present in the environment the value (which may be empty) or if the variable is unset, a fallback value is returned.
func GetDurationEnv ¶
GetDurationEnv returns the time.Duration value of the environment variable named by the key.
If the variable is present in the environment the value (which may be empty) or if the variable is unset, a fallback value is returned.
func GetEnv ¶
GetEnv returns the string value of the environment variable named by the key.
If the variable is present in the environment the value (which may be empty) or if the variable is unset, a fallback value is returned.
func GetIntEnv ¶
GetIntEnv returns the integer value of the environment variable named by the key.
If the variable is present in the environment the value (which may be empty) or if the variable is unset, a fallback value is returned.
Source Files ¶
- Version
- v0.13.1 (latest)
- Published
- Jan 29, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 4 days ago –
Tools for package owners.