Download this file
| 1 | package moves |
| 2 | |
| 3 | // SwitchEnv is the operator-off switch of Phase 1 (index D13): every move |
| 4 | // entry point is behind it, and its default is off until the copy record |
| 5 | // is approved. |
| 6 | const SwitchEnv = "CARLOS_MOVES_PHASE1" |
| 7 | |
| 8 | // DefaultEnabled is the compiled default. The copy gate |
| 9 | // (approved_copy_test.go) requires it false while any copy row is pending. |
| 10 | const DefaultEnabled = false |
| 11 | |
| 12 | // Enabled reads the switch. Unset means the default; "on", "1" and "true" |
| 13 | // enable; anything else is off. |
| 14 | func Enabled(getenv func(string) string) bool { |
| 15 | switch getenv(SwitchEnv) { |
| 16 | case "": |
| 17 | return DefaultEnabled |
| 18 | case "on", "1", "true": |
| 19 | return true |
| 20 | } |
| 21 | return false |
| 22 | } |
| 23 | |