envflag

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package envflag loads environment variables from --env references and applies them to the current process. A reference is scheme-based: "file:<path>", "file://<path>", or a bare path all select a dotenv file. Applied values override the inherited host environment; with multiple references or duplicate keys, later ones win.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(refs []string) ([]string, error)

Load resolves each ref, parses it as a dotenv file, and applies every pair with os.Setenv. Later refs and later duplicate keys override earlier ones, and all override the pre-existing host environment. It returns the de-duplicated key names it set, in first-seen order, so callers can expose them (e.g. to the nono profile). Load(nil) is a no-op returning (nil, nil).

Types

This section is empty.

Jump to

Keyboard shortcuts

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