StringToBool converts a string to a boolean ignoring errors
(s string)
| 23 | |
| 24 | // StringToBool converts a string to a boolean ignoring errors |
| 25 | func StringToBool(s string) bool { |
| 26 | s = strings.ToLower(strings.TrimSpace(s)) |
| 27 | if s == "y" { |
| 28 | return true |
| 29 | } |
| 30 | b, _ := strconv.ParseBool(s) |
| 31 | return b |
| 32 | } |
no outgoing calls
no test coverage detected