+ Tag a config to remind them to stay hydrated
import "github.com/JoelPagliuca/conman"
var myAppConfig struct {
Port string `cmenv:"PORT" cmdefault:"8080"`
}
func init() {
cm, _ := conman.New()
cm.Hydrate(&myAppConfig)
}
This will try to set myAppConfig.Port
to:
- your
PORT
environment variable if it is set - then default to
8080
Check the godoc for more
Shout out to Marcus for the project name ❤️