Implement case conversion functions

Support camel case, snake case and kebab case
8 files changed
tree: 5d857af86de5a6d81a54252b50cc43017f5e2cdd
  1. .gitignore
  2. camel.go
  3. camel_test.go
  4. doc.go
  5. helper.go
  6. kebab.go
  7. kebab_test.go
  10. snake.go
  11. snake_test.go

Go strcase

The package strcase converts between different kinds of naming formats such as camel case (CamelCase), snake case (snake_case) or kebab case (kebab-case). The package is designed to work only with strings consisting of standard ASCII letters. Unicode is currently not supported.

Versioning and stability

Although the master branch is supposed to remain always backward compatible, the repository contains version tags in order to support vendoring tools such as glide. The tag names follow semantic versioning conventions and have the following format v1.0.0.

Install and use

go get -u

var snake = strcase.SnakeCase("CamelCase")