|
3 | 3 | [](https://godoc.org/github.com/stoewer/go-strcase)
|
4 | 4 | ---
|
5 | 5 |
|
6 |
| -# Go strcase |
| 6 | +Go strcase |
| 7 | +========== |
7 | 8 |
|
8 | 9 | The package `strcase` converts between different kinds of naming formats such as camel case
|
9 | 10 | (`CamelCase`), snake case (`snake_case`) or kebab case (`kebab-case`).
|
10 | 11 | The package is designed to work only with strings consisting of standard ASCII letters.
|
11 | 12 | Unicode is currently not supported.
|
12 | 13 |
|
13 |
| -## Versioning and stability |
| 14 | +Versioning and stability |
| 15 | +------------------------ |
14 | 16 |
|
15 | 17 | Although the master branch is supposed to remain always backward compatible, the repository
|
16 |
| -contains version tags in order to support vendoring tools such as `glide`. |
| 18 | +contains version tags in order to support vendoring tools. |
17 | 19 | The tag names follow semantic versioning conventions and have the following format `v1.0.0`.
|
| 20 | +This package supports Go modules introduced with version 1.11. |
18 | 21 |
|
19 |
| - |
20 |
| -## Install and use |
21 |
| - |
22 |
| -```sh |
23 |
| -go get -u github.com/stoewer/go-strcase |
24 |
| -``` |
| 22 | +Example |
| 23 | +------- |
25 | 24 |
|
26 | 25 | ```go
|
27 | 26 | import "github.com/stoewer/go-strcase"
|
28 | 27 |
|
29 | 28 | var snake = strcase.SnakeCase("CamelCase")
|
30 | 29 | ```
|
| 30 | + |
| 31 | +Dependencies |
| 32 | +------------ |
| 33 | + |
| 34 | +### Build dependencies |
| 35 | + |
| 36 | +* none |
| 37 | + |
| 38 | +### Test dependencies |
| 39 | + |
| 40 | +* `github.com/stretchr/testify` |
| 41 | + |
| 42 | +Run linters and unit tests |
| 43 | +-------------------------- |
| 44 | + |
| 45 | +Since some of the linters ran by gometalinter don't support go modules yet, test dependencies have to be |
| 46 | +loaded to the vendor directory first and gometalinter itself must run with disabled module support: |
| 47 | + |
| 48 | +``` |
| 49 | +go mod vendor |
| 50 | +GO111MODULE=off gometalinter --config=.gometalinter.json --deadline=10m . |
| 51 | +``` |
| 52 | + |
| 53 | +To run the test use the following commands: |
| 54 | + |
| 55 | +``` |
| 56 | +go test . |
| 57 | +``` |
0 commit comments