Skip to content

Commit

Permalink
refine variable naming as per PR review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
zrma authored and omissis committed Jan 18, 2024
1 parent ba21b6d commit 40f48ce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/x/text/cases.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ func (c *Caser) Identifierize(s string) string {

rIdent := []rune(ident)
if len(rIdent) > 0 {
if !unicode.IsLetter(rIdent[0]) || isNoneCaseSensitiveLetter(rIdent[0]) {
if !unicode.IsLetter(rIdent[0]) || isNotCaseSensitiveLetter(rIdent[0]) {
ident = "A" + ident
}
}

return ident
}

func isNoneCaseSensitiveLetter(r rune) bool {
func isNotCaseSensitiveLetter(r rune) bool {
return !unicode.IsUpper(r) && !unicode.IsLower(r)
}

Expand Down Expand Up @@ -86,7 +86,7 @@ func splitIdentifierByCaseAndSeparators(s string) []string {
stateNothing state = iota
stateLower
stateUpper
stateNonCase
stateNoCase
stateNumber
stateDelimiter
)
Expand Down Expand Up @@ -114,7 +114,7 @@ func splitIdentifierByCaseAndSeparators(s string) []string {
nextState = stateDelimiter

default: // Non-case sensitive letters.
nextState = stateNonCase
nextState = stateNoCase
}

if nextState != currState {
Expand Down

0 comments on commit 40f48ce

Please sign in to comment.