Small lib for configuring your go code according to current environment RUN_ENV
.
go get github.com/thedanielforum/env
To get the current env you should call env.InitEnv()
when your application is starting.
It is important to call env.InitEnv()
or env.SetEnv("the env you want")
before calling any og the "IsEnv" functions.
package main
import (
"fmt"
"github.com/thedanielforum/env"
)
func init() {
env.InitEnv()
}
func main() {
fmt.Println(env.GetEnv().String())
}