improved output

This commit is contained in:
Mat Ryer 2016-08-29 13:09:34 +01:00
parent 6a2af83edc
commit da0b19b274
2 changed files with 15 additions and 1 deletions

View File

@ -10,6 +10,6 @@ type Person struct {
} }
type PersonStore interface { type PersonStore interface {
Get(context.Context, string) (*Person, error) Get(ctx context.Context, id string) (*Person, error)
Create(ctx context.Context, person *Person, confirm bool) error Create(ctx context.Context, person *Person, confirm bool) error
} }

View File

@ -161,6 +161,20 @@ package todo
// github.com/matryer/moq // github.com/matryer/moq
{{ range .Objs }} {{ range .Objs }}
// {{.Name}}Mock is a mock implementation of {{.Name}}. // {{.Name}}Mock is a mock implementation of {{.Name}}.
//
// func TestSomethingThatUses{{.Name}}(t *testing.T) {
//
// // make and configure a mocked {{.Name}}
// mocked{{.Name}} := {{.Name}}Mock{
// {{ range .Methods }}{{.Name}}Func: func({{ .Arglist }}) {{.ReturnArglist}} {
// panic("TODO: mock out the {{.Name}} function")
// },
// {{end}}
// }
//
// // TODO: use mocked{{.Name}} in code that requires {{.Name}}
//
// }
type {{.Name}}Mock struct { type {{.Name}}Mock struct {
{{ range .Methods }} {{ range .Methods }}
// {{.Name}}Func mocks the {{.Name}} function. // {{.Name}}Func mocks the {{.Name}} function.