Trim space from env variables (#1399)

This commit is contained in:
Jake Sanders
2020-03-24 14:51:43 +00:00
committed by GitHub
parent 84b4eb5404
commit 914340585c

View File

@@ -15,6 +15,7 @@ import (
"net/url"
"os"
"strconv"
"strings"
"time"
"github.com/micro/go-micro/v2/store"
@@ -79,9 +80,9 @@ type apiMessage struct {
// getOptions returns account id, token and namespace
func getOptions() (string, string, string) {
accountID := os.Getenv("CF_ACCOUNT_ID")
apiToken := os.Getenv("CF_API_TOKEN")
namespace := os.Getenv("KV_NAMESPACE_ID")
accountID := strings.TrimSpace(os.Getenv("CF_ACCOUNT_ID"))
apiToken := strings.TrimSpace(os.Getenv("CF_API_TOKEN"))
namespace := strings.TrimSpace(os.Getenv("KV_NAMESPACE_ID"))
return accountID, apiToken, namespace
}