Added readme

This commit is contained in:
alvaroloes 2015-12-29 13:27:33 +00:00
parent 58c57e5d15
commit 3e5724bd2a
1 changed files with 19 additions and 0 deletions

19
README.md Normal file
View File

@ -0,0 +1,19 @@
h1. Enumer
Enumer generates Go code to get string names from enum values and viceversa.
It is a fork of [Rob Pikes Stringer tool](https://godoc.org/golang.org/x/tools/cmd/stringer)
but adding a *"string to enum value"* method to the generated code.
For example, if we have an enum type called `Pill`, executing `enumer -type=Pill` will generate two methods:
```
func (i Pill) String() string {
//...
}
func PillString(s string) (Pill, error) {
//...
}
```
For more information on how to use, please go to the [Stringer docs](https://godoc.org/golang.org/x/tools/cmd/stringer)