https://github.com/ian-kent/envconf
Configure Go applications from the environment
https://github.com/ian-kent/envconf
Last synced: 11 months 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 (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-10-26T12:12:40.000Z (over 11 years ago)
- Last Synced: 2025-03-26T01:23:41.626Z (11 months ago)
- Language: Go
- Size: 97.7 KB
- Stars: 11
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-go - envconf
- awesome-go - envconf - 环境配置 (<span id="组态-configuration">组态 Configuration</span> / <span id="高级控制台用户界面-advanced-console-uis">高级控制台用户界面 Advanced Console UIs</span>)
- fucking-awesome-go - :octocat: envconf - Configuration from environment :star: 3 :fork_and_knife: 1 (Configuration / Advanced Console UIs)
- awesome-go - envconf - Configuration from environment. (Configuration / Advanced Console UIs)
- awesome-go - envconf - Configure Go applications from the environment - ★ 7 (Configuration)
- awesome-go - envconf - Configuration from environment. (Configuration / Standard CLI)
- awesome-go-cn - envconf
- awesome-go-cn - envconf
- awesome-go-cn - envconf - kent/envconf) [![godoc][D]](https://godoc.org/github.com/ian-kent/envconf) (配置 / 标准CLI)
- awesome-go - envconf - Configuration from environment. (Configuration / Advanced Console UIs)
- go-awesome-with-star-updatetime - envconf - Configuration from environment. (Configuration / Advanced Console UIs)
- awesome-Char - envconf - Configuration from environment. (Configuration / Advanced Console UIs)
- awesome-go-extra - envconf - 10-26T12:12:26Z|2014-10-26T12:12:40Z| (Configuration / Advanced Console UIs)
- awesome-go-processed - envconf - Configuration from environment.| (Configuration / Advanced Console UIs)
- awesome-go - envconf - Configuration from environment. - :arrow_down:13 - :star:3 (Configuration / Advanced Console UIs)
- awesome-go - envconf - Configuration from environment. (Configuration / Standard CLI)
- awesome-go - envconf - Configuration from environment. (Configuration / Standard CLI)
- awesome-go-info - envconf
- awesome-go - envconf - Configuration from environment. (Configuration / Standard CLI)
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 main
import(
"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.