Skip to content
Configure Go applications from the environment
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE.md
README.md
envconf.go
envconf_flag_test.go Initial commit Oct 26, 2014
envconf_test.go Initial commit Oct 26, 2014

README.md

envconf

Configure your Go application from the environment.

Supports most basic Go types and works nicely with the built in flag package.

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 for details.

You can’t perform that action at this time.