ValidPerformanceModeOptions returns a slice of valid performance mode options for the project config or global config if global is true.
(configType ConfigType)
| 18 | // ValidPerformanceModeOptions returns a slice of valid performance mode |
| 19 | // options for the project config or global config if global is true. |
| 20 | func ValidPerformanceModeOptions(configType ConfigType) []PerformanceMode { |
| 21 | switch configType { |
| 22 | case ConfigTypeGlobal: |
| 23 | return []PerformanceMode{ |
| 24 | PerformanceModeNone, |
| 25 | PerformanceModeMutagen, |
| 26 | } |
| 27 | case ConfigTypeProject: |
| 28 | return []PerformanceMode{ |
| 29 | PerformanceModeGlobal, |
| 30 | PerformanceModeNone, |
| 31 | PerformanceModeMutagen, |
| 32 | } |
| 33 | default: |
| 34 | panic(fmt.Errorf("invalid ConfigType: %v", configType)) |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | // IsValidPerformanceMode checks to see if the given performance mode |
| 39 | // option is valid. |