(sectionName string, required bool, callbacks ...ValidatorCallback)
| 271 | } |
| 272 | |
| 273 | func (a *Application) boolSection(sectionName string, required bool, callbacks ...ValidatorCallback) bool { |
| 274 | value := a.stringSection(sectionName, required, callbacks...) |
| 275 | |
| 276 | // Don't bother proceeding if there's already an error parsing the string |
| 277 | if a.validator.HasError(sectionName) || value == "" { |
| 278 | return false |
| 279 | } |
| 280 | |
| 281 | pass, boolean, message := ParseBool(value) |
| 282 | if !pass { |
| 283 | a.validator.AddError(sectionName, fmt.Sprintf("%t", boolean), message) |
| 284 | return false |
| 285 | } |
| 286 | |
| 287 | return boolean |
| 288 | } |
no test coverage detected