iancoleman / strcase

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

Add optional custom acronym maps where used. #44

Closed schmidtw closed 1 year ago

schmidtw commented 1 year ago

Add an optional acronym map to ToCamel() and ToLowerCamel() that allows users to customize the specific calls to these functions while not being bound to a single global instance of the mapping.

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.

schmidtw commented 1 year ago

I'm going to remove the variadic functions in favor of new functions for a simpler approach.