tweaks
This commit is contained in:
parent
5f095748f8
commit
99a46df581
@ -2,6 +2,8 @@ package example
|
|||||||
|
|
||||||
import "context"
|
import "context"
|
||||||
|
|
||||||
|
//go:generate moq PersonStore -out mockpersonstore_test.go
|
||||||
|
|
||||||
type Person struct {
|
type Person struct {
|
||||||
ID string
|
ID string
|
||||||
Name string
|
Name string
|
||||||
|
@ -78,9 +78,7 @@ func (m *Mocker) Mock(w io.Writer, name ...string) error {
|
|||||||
method.Returns = extractArgs(sig.Results(), "out%d")
|
method.Returns = extractArgs(sig.Results(), "out%d")
|
||||||
}
|
}
|
||||||
objs = append(objs, obj)
|
objs = append(objs, obj)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
err := m.tmpl.Execute(w, struct{ Objs []*obj }{Objs: objs})
|
err := m.tmpl.Execute(w, struct{ Objs []*obj }{Objs: objs})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1,16 +1,14 @@
|
|||||||
package moq_test
|
package moq
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"log"
|
"log"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/matryer/moq/package/moq"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMoq(t *testing.T) {
|
func TestMoq(t *testing.T) {
|
||||||
|
|
||||||
m, err := moq.New("../../example")
|
m, err := New("../../example")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("moq.New: %s", err)
|
t.Errorf("moq.New: %s", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user