Summon makes using environment variables safely.
sm := summon.New(os.Getenv("ENV"))
sm.Inject("AUTH_KEY", "token_for_local")
token , err := sm.Get("AUTH_KEY").ToString()
sm := summon.New(os.Getenv("ENV"))
sm.Inject("AUTH_KEY", "token_for_local") // Insert "ENV":"token_for_local" into map.
token , err := sm.Get("AUTH_KEY").ToString() // "token_for_local", nil
sm := summon.New(os.Getenv("ENV"))
sm.Inject("AUTH_KEY", "token_for_local") // panic
// Try getting a null key
token , err := sm.Get("TOKEN").ToString() // return "", error:`"TOKEN" s not injected yet`
sm := summon.New(os.Getenv("ENV"))
sm.Inject("AUTH_KEY", "token_for_local") // Insert "ENV":"aaa" into map.
token , err := sm.Get("AUTH_KEY").ToString() // "aaa", nil