Merge pull request #22 from GodsBoss/master

Fix typo.
This commit is contained in:
Álvaro López Espinosa 2018-02-05 11:22:47 +00:00 committed by GitHub
commit 056aba1393
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -85,7 +85,7 @@ name := MyTypeValue.String() // name => "MyTypeValue"
``` ```
Sometimes you need to use some other string representation format than CamelCase (i.e. in JSON). Sometimes you need to use some other string representation format than CamelCase (i.e. in JSON).
To transform it from CamelCase to snake_case or kebab-case, you can use the `transform` flag. To transform it from CamelCase to snake_case or kebab-case, you can use the `transform` flag.
For example, the command `enumer -type=MyType -json -transform=snake` would generate the following string representation: For example, the command `enumer -type=MyType -json -transform=snake` would generate the following string representation:
@ -93,7 +93,7 @@ For example, the command `enumer -type=MyType -json -transform=snake` would gene
```go ```go
name := MyTypeValue.String() // name => "my_type_value" name := MyTypeValue.String() // name => "my_type_value"
``` ```
**Note**: The transformation only works form CamelCase to sanake_case or kebab-case, not the other way around. **Note**: The transformation only works form CamelCase to snake_case or kebab-case, not the other way around.
## How to use ## How to use
The usage of Enumer is the same as Stringer, so you can refer to the [Stringer docs](https://godoc.org/golang.org/x/tools/cmd/stringer) The usage of Enumer is the same as Stringer, so you can refer to the [Stringer docs](https://godoc.org/golang.org/x/tools/cmd/stringer)