envflag

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package envflag extends flag parsing with environment-variable fallback.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse()

Parse parses environment vars and command-line flags.

Flags set via command-line override flags set via environment vars.

This function must be called instead of flag.Parse() before using any flags in the program.

func ParseFlagSet

func ParseFlagSet(fs *flag.FlagSet, args []string)

ParseFlagSet parses the given args into the given fs.

func ParseFlagSetErr

func ParseFlagSetErr(fs *flag.FlagSet, args []string) error

ParseFlagSetErr behaves like ParseFlagSet but returns an error instead of calling log.Fatalf. Use this when the caller prefers to handle parse errors instead of exiting the process.

Types

This section is empty.

Jump to

Keyboard shortcuts

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