dotenv

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvaluateExpressionValue

func EvaluateExpressionValue(eval evaluator.ExpressionEvaluator, value string) string

EvaluateExpressionValue evaluates value through eval with deferred evaluation enabled so secrets resolve immediately. Formats a resolution error inline as "<ERROR: ...>" and normalizes a nil result to the empty string.

func Parse

func Parse(content string) map[string]string

Parse parses standard dotenv content (KEY=VALUE lines, # comments, blank lines) into a map. Lines without a top-level "=" are skipped silently.

func ShouldUseCache

func ShouldUseCache(lookupEnv func(string) (string, bool)) bool

ShouldUseCache reports whether a cached value should be reused rather than re-evaluated, based on the NO_CACHE environment variable (read via lookupEnv). Cache is enabled by default and disabled by setting NO_CACHE=1 or NO_CACHE=true.

func WarnOnLoosePermissions

func WarnOnLoosePermissions(w io.Writer, goos, path string, mode os.FileMode)

WarnOnLoosePermissions writes a non-fatal warning to w when path's mode is group- or world-accessible rather than restricted to the owner (0600-equivalent). A no-op when goos is "windows": NTFS has no owner/group/other model, so FileMode bits there don't reflect real ACL restrictiveness and chmod has no equivalent.

Types

This section is empty.

Jump to

Keyboard shortcuts

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