Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ian-kent/envconf
Configure Go applications from the environment
https://github.com/ian-kent/envconf
Last synced: about 1 month ago
JSON representation
Configure Go applications from the environment
- Host: GitHub
- URL: https://github.com/ian-kent/envconf
- Owner: ian-kent
- License: mit
- Created: 2014-10-26T12:12:26.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-26T12:12:40.000Z (about 10 years ago)
- Last Synced: 2024-10-31T18:38:22.059Z (about 1 month ago)
- Language: Go
- Size: 97.7 KB
- Stars: 11
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-go - envconf - Configuration from environment. (Configuration / Standard CLI)
- awesome-go - envconf - Configure Go applications from the environment - ★ 7 (Configuration)
- awesome-go-extra - envconf - 10-26T12:12:26Z|2014-10-26T12:12:40Z| (Configuration / Advanced Console UIs)
README
envconf
=======Configure your Go application from the environment.
Supports most basic Go types and works nicely with the built in `flag` package.
```go
package mainimport(
"flag"
"fmt"
. "github.com/ian-kent/envconf"
)func main() {
count := flag.Int("count", FromEnvP("COUNT", 15).(int), "Count target")
flag.Parse()
for i := 1; i <= *count; i++ {
fmt.Printf("%d\n", i)
}
}
```## Licence
Copyright © 2014, Ian Kent (http://iankent.uk).
Released under MIT license, see [LICENSE](LICENSE.md) for details.