Returns the bool value of the input. The 2nd return value indicates if the input was a valid bool value
(input string)
| 90 | // Returns the bool value of the input. |
| 91 | // The 2nd return value indicates if the input was a valid bool value |
| 92 | func readBool(input string) (value bool, valid bool) { |
| 93 | switch input { |
| 94 | case "1", "true", "TRUE", "True": |
| 95 | return true, true |
| 96 | case "0", "false", "FALSE", "False": |
| 97 | return false, true |
| 98 | } |
| 99 | |
| 100 | // Not a valid bool value |
| 101 | return |
| 102 | } |
| 103 | |
| 104 | /****************************************************************************** |
| 105 | * Time related utils * |
no outgoing calls