github.com/goph/env (go): Package env provides a similar interface for environment variables as flag/pflag package.  The reason for this is to make configuration management in a CLI application as easy as possible. Environment variables are mostly used in server applications (eg. apps running in docker) though, so this solution is mostly beneficial for them.  Use this package along with the flag package from the stdlib or the POSIX compliant pflag (github.com/spf13/pflag) library. The general recommendation is to let flags take precedence over environment variables (when it makes sense to accept a configuration via both methods). To achieve this, make sure to parse flags after environment variables.  Here is an example for a regular application using both flags and environment variables:
Keywords: configuration|environment-variables