MCPcopy Create free account
hub / github.com/github/gh-aw / isFeatureInEnvironment

Function isFeatureInEnvironment

pkg/workflow/features.go:92–110  ·  view source on GitHub ↗
(flagLower string, logEnabled bool)

Source from the content-addressed store, hash-verified

90}
91
92func 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}

Callers 1

isFeatureEnabledFunction · 0.85

Calls 2

GetenvMethod · 0.80
PrintfMethod · 0.45

Tested by

no test coverage detected