From 26b5699cfbb2904e0d4b64ce1814b5811f3623ff Mon Sep 17 00:00:00 2001 From: Kunihiko Tanaka Date: Sun, 21 Jan 2018 17:13:03 +0900 Subject: [PATCH] Set env variables to viper (#664) --- fn/common/common.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fn/common/common.go b/fn/common/common.go index 6660fb9f..22d296d2 100644 --- a/fn/common/common.go +++ b/fn/common/common.go @@ -4,9 +4,6 @@ import ( "bytes" "errors" "fmt" - "github.com/iron-io/functions/fn/langs" - functions "github.com/iron-io/functions_go" - "github.com/spf13/viper" "io" "io/ioutil" "log" @@ -16,6 +13,10 @@ import ( "path/filepath" "strings" "text/template" + + "github.com/iron-io/functions/fn/langs" + functions "github.com/iron-io/functions_go" + "github.com/spf13/viper" ) var ( @@ -30,6 +31,7 @@ var ( ) func SetEnv() { + viper.AutomaticEnv() API_VERSION = "/v1" SSL_SKIP_VERIFY = (os.Getenv("SSL_SKIP_VERIFY") == "true") JWT_AUTH_KEY = viper.GetString("jwt_auth_key")