Skip to content

Commit

Permalink
quick fix 99designs#577 if we already have a camel name
Browse files Browse the repository at this point in the history
  • Loading branch information
giter authored Mar 8, 2019
1 parent d872af6 commit e435e72
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions codegen/templates/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,28 @@ func Call(p *types.Func) string {
}

func ToGo(name string) string {

// skip if we already have a camel name
if len(name) > 0 {

k := name[0]
if k >= 'A' && k <= 'Z' {

isCamel := false

for _, c := range name {
if isDelimiter(c) {
isCamel = true
break
}
}

if !isCamel {
return name
}
}
}

runes := make([]rune, 0, len(name))

wordWalker(name, func(info *wordInfo) {
Expand Down

0 comments on commit e435e72

Please sign in to comment.