Skip to content

Commit

Permalink
check input env var by value instead of presence (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
morphy2k authored Jan 24, 2025
1 parent 7f5920a commit fe340a9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions input.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func parseInput() (*input, error) {
}

func (i *input) parseExclude() error {
if v, ok := os.LookupEnv(envExclude); ok && v != "" {
if v := os.Getenv(envExclude); v != "" {
switch {
case strings.Contains(v, ";"):
i.exclude = strings.Split(v, ";")
Expand All @@ -65,23 +65,23 @@ func (i *input) parseExclude() error {
}

func (i *input) parseConfig() error {
if v, ok := os.LookupEnv(envConfig); ok {
if v := os.Getenv(envConfig); v != "" {
i.config = v
}

return nil
}

func (i *input) parsePath() error {
if v, ok := os.LookupEnv(envPath); ok {
if v := os.Getenv(envPath); v != "" {
i.path = v
}

return nil
}

func (i *input) parseFailOnAny() error {
if v, ok := os.LookupEnv(envFailOnAny); ok {
if v := os.Getenv(envFailOnAny); v != "" {
b, err := strconv.ParseBool(v)
if err != nil {
return fmt.Errorf("invalid value: %w", err)
Expand Down

0 comments on commit fe340a9

Please sign in to comment.