func stringToBool()

in apt/method.go [232:249]


func stringToBool(s string) bool {
	if i, err := strconv.Atoi(s); err == nil {
		if i == 1 {
			return true
		}
		return false
	}

	sl := strings.ToLower(s)
	trueStrs := []string{"yes", "true", "with", "on", "enable"}
	for _, trueStr := range trueStrs {
		if sl == trueStr {
			return true
		}
	}

	return false
}