From 764e1ef8e5787b948f8907c9485f42f61847fea6 Mon Sep 17 00:00:00 2001 From: pdrum Date: Thu, 9 Aug 2018 01:41:52 +0430 Subject: [PATCH 1/3] Remove TODO comments from template.go --- pkg/moq/template.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/moq/template.go b/pkg/moq/template.go index 8f55df1..31a6c60 100644 --- a/pkg/moq/template.go +++ b/pkg/moq/template.go @@ -29,12 +29,12 @@ var ( // // make and configure a mocked {{.InterfaceName}} // mocked{{.InterfaceName}} := &{{.InterfaceName}}Mock{ {{ range .Methods }} // {{.Name}}Func: func({{ .Arglist }}) {{.ReturnArglist}} { -// panic("TODO: mock out the {{.Name}} method") +// panic("mock out the {{.Name}} method") // },{{- end }} // } // -// // TODO: use mocked{{.InterfaceName}} in code that requires {{.InterfaceName}} -// // and then make assertions. +// // use mocked{{.InterfaceName}} in code that requires {{.InterfaceName}} +// // and then make assertions. // // } type {{.InterfaceName}}Mock struct { From 5bdba044b9e94ecb391514cf463b334ba0e2d6e7 Mon Sep 17 00:00:00 2001 From: Roman Levin Date: Wed, 14 Nov 2018 14:33:29 +0100 Subject: [PATCH 2/3] Test on supported versions of Go Golint won't even install currently. Also change the `go get` command to use `golang.org/x/lint/golint`. --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9b3ca76..ebf53b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,13 @@ language: go sudo: false go: - - 1.7.x - - 1.8.x + - 1.9.x + - 1.10.x + - 1.11.x - tip before_install: - - go get github.com/golang/lint/golint + - go get golang.org/x/lint/golint before_script: - go vet ./... From 2eb3df732a9f2aa2eb9f7b19e9e9758712d6f1c6 Mon Sep 17 00:00:00 2001 From: Lucas Bremgartner Date: Tue, 27 Nov 2018 18:30:46 +0100 Subject: [PATCH 3/3] Update mocks with go generate --- example/mockpersonstore_test.go | 8 ++++---- generate/generated.go | 10 +++++----- pkg/moq/testpackages/dotimport/service_moq_test.go | 6 +++--- .../testpackages/gogenvendoring/user/user_moq_test.go | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/example/mockpersonstore_test.go b/example/mockpersonstore_test.go index a0880b5..6c19d91 100755 --- a/example/mockpersonstore_test.go +++ b/example/mockpersonstore_test.go @@ -20,15 +20,15 @@ var ( // // make and configure a mocked PersonStore // mockedPersonStore := &PersonStoreMock{ // CreateFunc: func(ctx context.Context, person *Person, confirm bool) error { -// panic("TODO: mock out the Create method") +// panic("mock out the Create method") // }, // GetFunc: func(ctx context.Context, id string) (*Person, error) { -// panic("TODO: mock out the Get method") +// panic("mock out the Get method") // }, // } // -// // TODO: use mockedPersonStore in code that requires PersonStore -// // and then make assertions. +// // use mockedPersonStore in code that requires PersonStore +// // and then make assertions. // // } type PersonStoreMock struct { diff --git a/generate/generated.go b/generate/generated.go index e6ba29a..ee4d6eb 100644 --- a/generate/generated.go +++ b/generate/generated.go @@ -20,18 +20,18 @@ var ( // // make and configure a mocked MyInterface // mockedMyInterface := &MyInterfaceMock{ // OneFunc: func() bool { -// panic("TODO: mock out the One method") +// panic("mock out the One method") // }, // ThreeFunc: func() string { -// panic("TODO: mock out the Three method") +// panic("mock out the Three method") // }, // TwoFunc: func() int { -// panic("TODO: mock out the Two method") +// panic("mock out the Two method") // }, // } // -// // TODO: use mockedMyInterface in code that requires MyInterface -// // and then make assertions. +// // use mockedMyInterface in code that requires MyInterface +// // and then make assertions. // // } type MyInterfaceMock struct { diff --git a/pkg/moq/testpackages/dotimport/service_moq_test.go b/pkg/moq/testpackages/dotimport/service_moq_test.go index c8aeb86..1d2212c 100755 --- a/pkg/moq/testpackages/dotimport/service_moq_test.go +++ b/pkg/moq/testpackages/dotimport/service_moq_test.go @@ -19,12 +19,12 @@ var ( // // make and configure a mocked Service // mockedService := &ServiceMock{ // UserFunc: func(ID string) (dotimport.User, error) { -// panic("TODO: mock out the User method") +// panic("mock out the User method") // }, // } // -// // TODO: use mockedService in code that requires Service -// // and then make assertions. +// // use mockedService in code that requires Service +// // and then make assertions. // // } type ServiceMock struct { diff --git a/pkg/moq/testpackages/gogenvendoring/user/user_moq_test.go b/pkg/moq/testpackages/gogenvendoring/user/user_moq_test.go index 109b691..0d27fa7 100644 --- a/pkg/moq/testpackages/gogenvendoring/user/user_moq_test.go +++ b/pkg/moq/testpackages/gogenvendoring/user/user_moq_test.go @@ -19,12 +19,12 @@ var ( // // make and configure a mocked Service // mockedService := &ServiceMock{ // DoSomethingFunc: func(in1 somerepo.SomeType) error { -// panic("TODO: mock out the DoSomething method") +// panic("mock out the DoSomething method") // }, // } // -// // TODO: use mockedService in code that requires Service -// // and then make assertions. +// // use mockedService in code that requires Service +// // and then make assertions. // // } type ServiceMock struct {