()
| 46 | var logMap = map[string]bool{} |
| 47 | |
| 48 | func (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 | |
| 66 | func (f *feature) EnableOnDev() *feature { |
| 67 | if build.IsDev { |
no outgoing calls