Minor cleanup.
This commit is contained in:
+1
-1
@@ -55,7 +55,7 @@ func camelCase(src string) (entries []string) {
|
||||
// split into fields based on class of unicode character
|
||||
for _, r := range src {
|
||||
var class int
|
||||
switch true {
|
||||
switch {
|
||||
case unicode.IsLower(r):
|
||||
class = 1
|
||||
case unicode.IsUpper(r):
|
||||
|
||||
@@ -383,16 +383,17 @@ func SplitEscaped(s string, sep rune) (out []string) {
|
||||
escaped := false
|
||||
token := ""
|
||||
for _, ch := range s {
|
||||
if escaped {
|
||||
switch {
|
||||
case escaped:
|
||||
token += string(ch)
|
||||
escaped = false
|
||||
} else if ch == '\\' {
|
||||
case ch == '\\':
|
||||
escaped = true
|
||||
} else if ch == sep && !escaped {
|
||||
case ch == sep && !escaped:
|
||||
out = append(out, token)
|
||||
token = ""
|
||||
escaped = false
|
||||
} else {
|
||||
default:
|
||||
token += string(ch)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user