MCPcopy Index your code
hub / github.com/jetify-com/devbox / Enabled

Method Enabled

internal/boxcli/featureflag/feature.go:48–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46var logMap = map[string]bool{}
47
48func (f *feature) Enabled() bool {
49 if f == nil {
50 return false
51 }
52 if on, err := strconv.ParseBool(os.Getenv(envNamePrefix + f.name)); err == nil {
53 status := "enabled"
54 if !on {
55 status = "disabled"
56 }
57 if !logMap[f.name] {
58 slog.Debug("Feature %q %s via environment variable.", f.name, status)
59 logMap[f.name] = true
60 }
61 return on
62 }
63 return f.enabled
64}
65
66func (f *feature) EnableOnDev() *feature {
67 if build.IsDev {

Callers 12

logRunFuncMethod · 0.80
PrintDevEnvMethod · 0.80
GetStorePathsMethod · 0.80
WriteScriptFileFunction · 0.80
RootCmdFunction · 0.80
AllFunction · 0.80
TestEnabledFeatureFunction · 0.80
TestDisabledFeatureFunction · 0.80
TestEnabledFeatureEnvFunction · 0.80
TestNonExistentFeatureFunction · 0.80
IsEnabledFunction · 0.80
FetchResolvedPackageMethod · 0.80

Calls

no outgoing calls

Tested by 4

TestEnabledFeatureFunction · 0.64
TestDisabledFeatureFunction · 0.64
TestEnabledFeatureEnvFunction · 0.64
TestNonExistentFeatureFunction · 0.64