(flagLower string, logEnabled bool)
| 90 | } |
| 91 | |
| 92 | func isFeatureInEnvironment(flagLower string, logEnabled bool) bool { |
| 93 | features := os.Getenv("GH_AW_FEATURES") |
| 94 | if features == "" { |
| 95 | if logEnabled { |
| 96 | featuresLog.Printf("Feature not found, GH_AW_FEATURES empty: %s=false", flagLower) |
| 97 | } |
| 98 | return false |
| 99 | } |
| 100 | |
| 101 | if logEnabled { |
| 102 | featuresLog.Printf("Checking GH_AW_FEATURES environment variable: %s", features) |
| 103 | } |
| 104 | for feature := range strings.SplitSeq(features, ",") { |
| 105 | if strings.EqualFold(strings.TrimSpace(feature), flagLower) { |
| 106 | return true |
| 107 | } |
| 108 | } |
| 109 | return false |
| 110 | } |
no test coverage detected