Skip to content

Configure Go applications from the environment

License

Notifications You must be signed in to change notification settings

companieshouse/envconf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/companieshouse/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.

About

Configure Go applications from the environment

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 95.9%
  • Makefile 4.1%