refactor options to be more generic
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package utils
|
||||
|
||||
import "strings"
|
||||
import (
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Mailbox returns mailbox part from email address
|
||||
func Mailbox(email string) string {
|
||||
@@ -25,3 +28,8 @@ func Bool(str string) bool {
|
||||
|
||||
return (str == "1" || str == "true" || str == "yes")
|
||||
}
|
||||
|
||||
// SanitizeBoolString converts string to boolean and back to string
|
||||
func SanitizeBoolString(str string) string {
|
||||
return strconv.FormatBool(Bool(str))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user