Slight adjustment to TitleCase

This commit is contained in:
Patrick O'brien 2016-08-22 15:10:15 +10:00
parent c4526d4d2c
commit 604fbea7de

View file

@ -167,18 +167,18 @@ func TitleCase(n string) string {
for start < ln {
// Find the start and end of the underscores to account
// for the possibility of being multiple underscores in a row.
if end < ln && name[start] == '_' {
if end < ln {
if name[start] == '_' {
start++
end++
continue
}
// Once we have found the end of the underscores, we can
// find the end of the first full word.
if end < ln && name[end] != '_' {
} else if name[end] != '_' {
end++
continue
}
}
word := name[start:end]
var vowels bool