env

package
v0.0.0-...-fb7f86c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lookup

func Lookup(name string, vars []string) (string, bool)

Lookup is the equivalent of os.LookupEnv, only you are able to provide the list of environment variables. To use this as os.LookupEnv would be used, simply call `env.Lookup("ENVIRONMENT_VARIABLE", os.Environ())`

func RequireListWithEnvFallback

func RequireListWithEnvFallback(cctx *cli.Context, name string, envName string) ([]string, error)

RequireListWithEnvFallback first checks the CLI for a flag with the required name. If this is empty, it falls back to taking the environment variable. Sadly, we cannot use cli.Flag.EnvVars for this due to it potentially leaking environment variables as default values in usage-errors.

func RequireStringWithEnvFallback

func RequireStringWithEnvFallback(cctx *cli.Context, name string, envName string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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