iancoleman / strcase

A golang package for converting to snake_case or CamelCase
MIT License
1.01k stars 106 forks source link

CUSTOMER_ID with ToCamel or ToLowerCamel not working #12

Closed nmijailovic closed 1 year ago

nmijailovic commented 5 years ago

CUSTOMER_ID with ToCamel or ToLowerCamel not working ToCamel = CUSTOMERID instead of CustomerId ToLowerCamel = cUSTOMERID instead of customerId

nfam commented 5 years ago

I recommend you use strcase.ToCamel(strings.ToLower("CUSTOMER_ID")). If you expect strcase.ToCamel("CUSTOMER_ID") == "CustomerId", then strcase.ToCamel("CustomerId") will be Customerid which is not the result we want.