Skip to content

Commit

Permalink
Add IsSet()
Browse files Browse the repository at this point in the history
  • Loading branch information
aeijdenberg committed Jul 10, 2018
1 parent cfec663 commit d32dbbd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ func (v *VarSet) Lookup(name string) (string, bool) {
return "", false
}

// IsSet looks for a given name within all lookup sources in order.
// If found, true is returned, else false.
func (v *VarSet) IsSet(name string) bool {
_, ok := v.Lookup(name)
return ok
}

// IsVarNotFound returns a boolean indicating whether the error is known to
// report that an environment variable is not found.
func IsVarNotFound(err error) bool {
Expand Down

0 comments on commit d32dbbd

Please sign in to comment.