Updated README with syntax highlighting for Go snippets

This commit is contained in:
alvaroloes 2015-12-31 14:41:41 +00:00
parent ce36ee186f
commit a8751cee5a
1 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ from a REST API request... In short, from those places where using the real enum
be almost meaningless or hard to trace or use by a human
For example, if we have an enum type called `Pill`,
```
```go
type Pill int
const (
@ -20,7 +20,7 @@ const (
)
```
executing `enumer -type=Pill` will generate a new file with two methods:
```
```go
func (i Pill) String() string {
//...
}
@ -30,7 +30,7 @@ func PillString(s string) (Pill, error) {
}
```
From now on, we can:
```
```go
// Convert any Pill value to string
var aspirinString string = Aspirin.String()
// (or use it in any place where a Stringer is accepted)