From 3e5724bd2a84b5a78445976a03cc202bb75bd1d0 Mon Sep 17 00:00:00 2001 From: alvaroloes Date: Tue, 29 Dec 2015 13:27:33 +0000 Subject: [PATCH] Added readme --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..a9a119b --- /dev/null +++ b/README.md @@ -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 Pike’s 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) \ No newline at end of file