Skip to content

darkhelmet/env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

env

Easy environment variables for Go

Usage

import "github.com/darkhelmet/env"

...

s := env.String("USER") // Will panic if USER is not present
sd := env.StringDefault("KEY", "It-Not-Present")
sdf := env.StringDefaultF("KEY", func() string { return "do something tough" })

// Similarly for int and float

env.Int("N") // Panic if not present
env.IntDefault("N", 1)
env.IntDefaultF("N", func() int { return 5 })

env.Float("F") // Panic if not present
env.FloatDefault("F", 1.0)
env.FloatDefaultF("F", func() float64 { return 5.5 })

License

Apache 2.0, see LICENSE.md

About

Easy environment variables for Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •