91acaaa573
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
16 lines
211 B
Go
16 lines
211 B
Go
package txt
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
// 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
|
|
}
|