isBoolConfig returns true if name is either name of a boolean config field, or a valid value for a multi-choice config field.
(name string)
| 268 | // isBoolConfig returns true if name is either name of a boolean config field, |
| 269 | // or a valid value for a multi-choice config field. |
| 270 | func isBoolConfig(name string) bool { |
| 271 | f, ok := configFieldMap[name] |
| 272 | if !ok { |
| 273 | return false |
| 274 | } |
| 275 | if name != f.name { |
| 276 | return true // name must be one possible value for the field |
| 277 | } |
| 278 | var cfg config |
| 279 | _, ok = cfg.fieldPtr(f).(*bool) |
| 280 | return ok |
| 281 | } |
| 282 | |
| 283 | // completeConfig returns the list of configurable names starting with prefix. |
| 284 | func completeConfig(prefix string) []string { |
no test coverage detected
searching dependent graphs…