iancoleman / strcase

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

Add new funcs allowing for non-global acronym maps. #45

Open schmidtw opened 1 year ago

schmidtw commented 1 year ago

Add two new functions ToCamelWithAcronyms() and ToLowerCamelWithAcronyms() that take a map[string]string of acronyms to use in place of the globally referenced value.

This allows for more complex use cases where the conversions may conflict or the access to the map may introduce a race condition, while preserving the existing API.