Open lrstanley opened 5 years ago
I think this would also address issues like https://github.com/iancoleman/strcase/issues/12 (i.e. convert every capital letter after the first into lowercase, unless it matches an exception). This would convert CUSTOMER_ID
into CustomerID
if done properly.
Looks ok.
Only doubt is whether RAM should be on the list for the purpose of this tool.
I'll look into adding this, I think it's a good idea. Thanks for raising the issue.
I can't help but think it should be from the lint code file, and would work as a specific GolangCamelCase method.
Looks like this was partially added in https://github.com/iancoleman/strcase/commit/10b280f8d209855767061d4b2a3c156dd590a068 quite awhile back, enough for others to be able to specify their own acronyms. Not perfect, but I think it's enough to close this issue.
Actually, it looks like that functionality doesn't work as intended. No matter how I try and use ConfigureAcronym
.
Thoughts on adding something similar?:
https://github.com/serenize/snaker/blob/a683aaf2d516deecd70cad0c72e3ca773ecfcef0/snaker.go#L100-L150
This would make it easier to use this for code generation. I.e. something like
TEST_HTTP
doesn't get converted toTestHttp
(which isn't a go standard), ratherTestHTTP
.