iancoleman / strcase

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

ToSnake not support string contains "." #16

Closed jzlikewei closed 4 years ago

jzlikewei commented 4 years ago

ToSnake("AwesomeAcitvity.UserID") should be "awesome_acitvity.user_id" but not "awesome_acitvity._user_id"

floydspace commented 4 years ago

Hey @jzlikewei, shouldn't it be awesome_acitvity_user_id?

iancoleman commented 4 years ago

See #17 test which fixes this in func TestToSnakeWithIgnore(t *testing.T)

https://github.com/iancoleman/strcase/blob/44067336ae3b42cd97c86be08287cf674b7ca193/snake_test.go#L78

Thanks @jzlikewei