Skip to content

Commit 26b5699

Browse files
kunihiko-tc0ze
authored andcommitted
Set env variables to viper (#664)
1 parent 4656100 commit 26b5699

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

fn/common/common.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ import (
44
"bytes"
55
"errors"
66
"fmt"
7-
"github.com/iron-io/functions/fn/langs"
8-
functions "github.com/iron-io/functions_go"
9-
"github.com/spf13/viper"
107
"io"
118
"io/ioutil"
129
"log"
@@ -16,6 +13,10 @@ import (
1613
"path/filepath"
1714
"strings"
1815
"text/template"
16+
17+
"github.com/iron-io/functions/fn/langs"
18+
functions "github.com/iron-io/functions_go"
19+
"github.com/spf13/viper"
1920
)
2021

2122
var (
@@ -30,6 +31,7 @@ var (
3031
)
3132

3233
func SetEnv() {
34+
viper.AutomaticEnv()
3335
API_VERSION = "/v1"
3436
SSL_SKIP_VERIFY = (os.Getenv("SSL_SKIP_VERIFY") == "true")
3537
JWT_AUTH_KEY = viper.GetString("jwt_auth_key")

0 commit comments

Comments
 (0)