proxy.golang.org : github.com/goph/env
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:
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/goph/env
Keywords:
configuration
, environment-variables
License: MIT
Latest release: almost 7 years ago
First release: about 7 years ago
Namespace: github.com/goph
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 14 days ago