// LoadEnvironmentFile loads the correct envfile based on the convention // envfile name ==> .<env> func LoadEnvironmentFile(env string) { envfile := config.DOT + string(os.PathSeparator) + config.DOT + s.ToLower(env) error := gotenv.Load(envfile) if error != nil { logger.Info("ERROR loading environment file: " + error.Error()) } }
func init() { gotenv.Load(".env") access = os.Getenv("AWS_ACCESS") secret = os.Getenv("AWS_SECRET") bucket = os.Getenv("AWS_BUCKET") region = os.Getenv("AWS_REGION") }
func init() { gotenv.Load(".env") host = os.Getenv("ES_HOST") index = os.Getenv("ES_INDEX") namespace = os.Getenv("ES_NAMESPACE") scheme = os.Getenv("ES_SCHEME") awsKey = os.Getenv("AWS_KEY") awsSecret = os.Getenv("AWS_SECRET") }
func init() { // attempt to load env vars in memcache pacakge. gotenv.Load(".env") v := os.Getenv("MEMCACHED_HOSTS") if v != "" { hosts = strings.Split(v, ",") return } }
func checkEnv(t *testing.T) { if envLoaded == false { gotenv.Load(".env") access = os.Getenv("AWS_ACCESS") secret = os.Getenv("AWS_SECRET") region = os.Getenv("AWS_REGION") dbtable = os.Getenv("DYNAMO_DB_TABLE") envLoaded = true } if access == "" || secret == "" || region == "" || dbtable == "" { t.Skip("env vars not defined") } }
func init() { gotenv.Load() r = rand.New(rand.NewSource(time.Now().UnixNano())) if os.Getenv("PUSHERAPPID") == "" { panic(".env file or Pusher AppID missing! Ensure .env file from the #gosimulateyourself channel has been placed in this directory") } pushClient = pusher.Client{ AppId: os.Getenv("PUSHERAPPID"), Key: os.Getenv("PUSHERKEY"), Secret: os.Getenv("PUSHERSECRET"), } fmt.Println("Loaded Pusher credentials from .env: AppId, Key, Secret: ", pushClient) }
// Read the evironment file, populating the environment variables to use. func loadConfig(envFile string) { gotenv.Load() }
func init() { gotenv.Load(".env") host, port = os.Getenv("REDIS_HOST"), os.Getenv("REDIS_PORT") }
func init() { gotenv.Load() }
func init() { gotenv.Load() setEnvVars() }