Skip to content

Commit

Permalink
Added package checkenv
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Khramtsov committed Sep 17, 2023
1 parent e3e5071 commit 337c2c6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pkg/checkenv/checkenv.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package checkenv

import "os"

type EnvChecker struct {
VariableNames []string
}

func NewEnvChecker(variableNames []string) *EnvChecker {
return &EnvChecker{VariableNames: variableNames}
}

func (e *EnvChecker) CheckAll() bool {
for _, variableName := range e.VariableNames {
if _, exists := os.LookupEnv(variableName); !exists {
return false
}
}
return true
}

0 comments on commit 337c2c6

Please sign in to comment.