Skip to content

nirmata/go-envflag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Define flags via command-line and / or environment variables.

This library allows definition of command line flags that use
environment variable values, when available, as defaults. This
is especially useful for containerized applications.

_______________________________________________________
Usage example:

import "envflag"

var (
  // flagB will be set to 'myflag' if specified on the command line, or
  // MY_ENV_VAR if specified as an environment variable, or defaultValue
  // if neither myflag or MY_ENV_VAR are specified.
	flagB      = envflag.Bool("myflag", "MY_ENV_VAR", defaultValue, "a boolean flag")
)

envflag.Parse()

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages