Skip to content

Commit

Permalink
fix: issue with missingkey for zero option
Browse files Browse the repository at this point in the history
  • Loading branch information
kha7iq committed Jul 8, 2021
1 parent 65c6e35 commit c34ee30
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ type Flags struct {

var (
GlobalOpts Flags
EnvVariables map[string]interface{}
EnvVariables map[string]string
)

// GetVars will get all the environment variables
func GetVars() (enVars map[string]interface{}) {
enVars = make(map[string]interface{})
func GetVars() (enVars map[string]string) {
enVars = make(map[string]string)
for _, value := range os.Environ() {
kv := strings.SplitN(value, "=", 2)
enVars[kv[0]] = kv[1]
Expand All @@ -37,8 +37,8 @@ func ParseString(str string) (*template.Template, error) {
}

// MatchPrefix will match a given prefix pattern of all env variables and render only those.
func MatchPrefix(prefix string) map[string]interface{} {
enVars := make(map[string]interface{})
func MatchPrefix(prefix string) map[string]string {
enVars := make(map[string]string)
for _, value := range os.Environ() {
kv := strings.SplitN(value, "=", 2)
if strings.HasPrefix(kv[0], prefix) {
Expand Down

0 comments on commit c34ee30

Please sign in to comment.