Skip to content

Commit

Permalink
Added older logic to backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
karantin2020 committed Jul 28, 2018
1 parent b324d69 commit f60cd99
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions backend/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ func NewBackend(fns ...opt) backend.Backend {
if ok {
return []byte(val), nil
}
if len(fns) == 0 {
key = strings.Replace(strings.ToUpper(key), "-", "_", -1)

val, ok = os.LookupEnv(key)
if ok {
return []byte(val), nil
}
}
return nil, backend.ErrNotFound
})
}
Expand Down

0 comments on commit f60cd99

Please sign in to comment.