spf13--viper/internal/insensitiveOpt/fix.go
2023-04-15 13:25:37 +08:00

28 lines
318 B
Go

package insensitiveopt
import (
"strings"
"unicode"
)
var insensitive = true
func Insensitive(f bool) {
insensitive = f
}
func ToLower(s string) string {
if insensitive {
return strings.ToLower(s)
}
return s
}
func ToLowerRune(s rune) rune {
if insensitive {
return unicode.ToLower(s)
}
return s
}