pflagenv

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package flagenv provides the ability to populate flags from environment variables.

Index

Constants

This section is empty.

Variables

View Source
var Prefix = ""

Specify a prefix for environment variables.

Functions

func Parse

func Parse()

Parse will set each defined flag from its corresponding environment variable . If dots or dash are presents in the flag name, they will be converted to underscores.

If Parse fails, a fatal error is issued.

func ParseSet

func ParseSet(prefix string, set *flag.FlagSet) error

ParseSet parses the given flagset. The specified prefix will be applied to the environment variable names.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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