2020-01-07 17:36:49 +01:00
|
|
|
package txt
|
2019-05-16 08:41:16 +02:00
|
|
|
|
|
|
|
import (
|
2019-06-13 20:26:01 +02:00
|
|
|
"strings"
|
2019-05-16 08:41:16 +02:00
|
|
|
)
|
|
|
|
|
2020-01-31 15:29:06 +01:00
|
|
|
// Bool casts a string to bool.
|
|
|
|
func Bool(s string) bool {
|
|
|
|
s = strings.TrimSpace(s)
|
|
|
|
|
|
|
|
if s == "" || s == "0" || s == "false" || s == "no" {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
return true
|
|
|
|
}
|