Skip to content

Commit

Permalink
Merge pull request #28 from martinlindhe/master
Browse files Browse the repository at this point in the history
README: enable syntax highlighting (github-markdown) for go snippets
  • Loading branch information
matryer authored Mar 28, 2017
2 parents fa59314 + 87c8140 commit a0db0c5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ To see a real example of how to use `genny` with `go generate`, look in the [exa

Define your generic types using the special `generic.Type` placeholder type:

```
```go
type KeyType generic.Type
type ValueType generic.Type
```
Expand All @@ -92,7 +92,7 @@ type ValueType generic.Type

Then write the generic code referencing the types as your normally would:

```
```go
func SetValueTypeForKeyType(key KeyType, value ValueType) { /* ... */ }
```

Expand All @@ -114,7 +114,7 @@ The output will be the complete Go source file with the generic types replaced w

Given [this generic Go code](https://github.com/cheekybits/genny/tree/master/examples/queue) which compiles and is tested:

```
```go
package queue

import "github.com/cheekybits/genny/generic"
Expand Down Expand Up @@ -148,7 +148,7 @@ cat source.go | genny gen "Something=string"

It outputs:

```
```go
// This file was automatically generated by genny.
// Any changes will be lost if this file is regenerated.
// see https://github.com/cheekybits/genny
Expand Down Expand Up @@ -187,7 +187,7 @@ Check out the [test code files](https://github.com/cheekybits/genny/tree/master/

Once you have defined a generic type with some code worth testing:

```
```go
package slice

import (
Expand Down Expand Up @@ -216,7 +216,7 @@ func EnsureMyTypeSlice(objectOrSlice interface{}) []MyType {

You can treat it like any normal Go type in your test code:

```
```go
func TestEnsureMyTypeSlice(t *testing.T) {

myType := new(MyType)
Expand Down

0 comments on commit a0db0c5

Please sign in to comment.