From 78083d2e52b9e06b10eac41f4f21271da8fdfd45 Mon Sep 17 00:00:00 2001 From: Mat Ryer Date: Tue, 4 Jul 2017 17:48:32 -0600 Subject: [PATCH] Neatened up generated code --- package/moq/moq.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package/moq/moq.go b/package/moq/moq.go index 628e25e..0eff431 100644 --- a/package/moq/moq.go +++ b/package/moq/moq.go @@ -216,7 +216,7 @@ var moqTemplate = `package {{.PackageName}} // // make and configure a mocked {{.InterfaceName}} // mocked{{.InterfaceName}} := &{{.InterfaceName}}Mock{ {{ range .Methods }} // {{.Name}}Func: func({{ .Arglist }}) {{.ReturnArglist}} { -// panic("TODO: mock out the {{.Name}} function") +// panic("TODO: mock out the {{.Name}} method") // },{{- end }} // } // @@ -225,7 +225,7 @@ var moqTemplate = `package {{.PackageName}} // } type {{.InterfaceName}}Mock struct { {{- range .Methods }} - // {{.Name}}Func mocks the {{.Name}} function. + // {{.Name}}Func mocks the {{.Name}} method. {{.Name}}Func func({{ .Arglist }}) {{.ReturnArglist}} {{- end }} } @@ -235,11 +235,11 @@ func (mock *{{$obj.InterfaceName}}Mock) {{.Name}}({{.Arglist}}) {{.ReturnArglist if mock.{{.Name}}Func == nil { panic("moq: {{$obj.InterfaceName}}Mock.{{.Name}}Func is nil but was just called") } - {{ if .ReturnArglist }} +{{- if .ReturnArglist }} return mock.{{.Name}}Func({{.ArgCallList}}) - {{ else }} +{{- else }} mock.{{.Name}}Func({{.ArgCallList}}) - {{ end }} +{{- end }} } {{ end -}} {{ end -}}`