strcase
strcase copied to clipboard
A golang package for converting to snake_case or CamelCase
Very useful library. Thank you. :) Processing as bytes works fine for the Latin alphabet, but processing as runes could allow the library to process other Unicode alphabets, using `unicode.ToLower`...
Numbers usually act as word boundaries, but not always (which I believe is a bug). Here are inconsistent test cases: ```go strcase.ToSnake("1A2") // 1a_2 strcase.ToSnake("A1B") // a_1_b ```
# What? The current implementation of the `ToCamelCase` func does not put a delimiter between two numbers. For example `test 123 456` get transformed to `test123456` but in my opinion...
How about adding an option to generate camelCase Go structs from snake-case XML structs? For example, from To generate, type Address struct { XMLName xml.Name `xml:"Address,omitempty" json:"Address,omitempty"` City *City `xml:"city,omitempty"...
`ToCamel` removes periods from strings but `ToSnake` does not. This seems a bit inconsistent. What is the best way to strip special characters?
There are some additional tests for ToSnake at [this gist](https://gist.github.com/regeda/969a067ff4ed6ffa8ed6) Would you like to add these: ```go []string{"ILoveGolangAndJSONSoMuch", "i_love_golang_and_json_so_much"}, []string{"ILoveJSON", "i_love_json"}, []string{"JSON", "json"}, []string{"Camel1", "camel1"}, []string{"BIGCase1", "big_case1"}, []string{"BC1", "b_c1"}, []string{"ПриветМир",...
I use this library to transform some Cloudformation parameters names into kebab notation `S3` is one of the AWS services when it's found in a parameter file it is transformed...