Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatExport ¶ added in v1.5.0
FormatExport formats an environment variable for the specified shell
func LoadDotenv ¶
LoadDotenv loads .env file(s) into the current process environment
func LoadDotenvOverride ¶
LoadDotenvOverride loads .env file(s) and overrides existing vars
func MustLoadDotenv ¶
func MustLoadDotenv(files ...string)
MustLoadDotenv loads .env file(s) and panics on error
Types ¶
type DotenvOptions ¶
type DotenvOptions struct {
Files []string // .env files to load
Export bool // -e: output as export statements
Quiet bool // -q: suppress warnings
Override bool // -o: override existing environment variables
Expand bool // -x: expand variables in values
Shell ShellType // -s: target shell for export format
}
DotenvOptions configures the dotenv command behavior
type EnvVar ¶
EnvVar represents an environment variable
func ParseDotenv ¶
func ParseDotenv(r io.Reader, opts DotenvOptions) ([]EnvVar, error)
ParseDotenv parses .env content from a reader
func ParseDotenvFile ¶
func ParseDotenvFile(path string, opts DotenvOptions) ([]EnvVar, error)
ParseDotenvFile parses a .env file and returns the variables
Click to show internal directories.
Click to hide internal directories.