diff --git a/Makefile b/Makefile index 6f77873..e25f780 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,6 @@ SHELL := /usr/bin/env bash all: \ yaml-format \ markdown-format \ - mockgen-generate \ go-mod-tidy \ go-test \ go-lint \ @@ -26,13 +25,3 @@ go-test: .PHONY: go-mod-tidy go-mod-tidy: go mod tidy -v - -# mockgen-generate: generate Go mocks -.PHONY: mockgen-generate -mockgen-generate: mockclock/clock.go - -mockclock/clock.go: clock.go - go run -mod=mod github.com/golang/mock/mockgen \ - -destination $@ \ - -package mockclock \ - go.einride.tech/clock Clock,Ticker diff --git a/go.mod b/go.mod index e8ad1c2..de1b66c 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module go.einride.tech/clock go 1.17 require ( - github.com/golang/mock v1.6.0 go.uber.org/zap v1.19.1 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c google.golang.org/protobuf v1.27.1 diff --git a/go.sum b/go.sum index acf4728..432d4ea 100644 --- a/go.sum +++ b/go.sum @@ -3,8 +3,6 @@ github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZx github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= @@ -54,7 +52,6 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/mockclock/clock.go b/mockclock/clock.go deleted file mode 100644 index 8d57bfb..0000000 --- a/mockclock/clock.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: go.einride.tech/clock (interfaces: Clock,Ticker) - -// Package mockclock is a generated GoMock package. -package mockclock - -import ( - reflect "reflect" - time "time" - - gomock "github.com/golang/mock/gomock" - clock "go.einride.tech/clock" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" -) - -// MockClock is a mock of Clock interface. -type MockClock struct { - ctrl *gomock.Controller - recorder *MockClockMockRecorder -} - -// MockClockMockRecorder is the mock recorder for MockClock. -type MockClockMockRecorder struct { - mock *MockClock -} - -// NewMockClock creates a new mock instance. -func NewMockClock(ctrl *gomock.Controller) *MockClock { - mock := &MockClock{ctrl: ctrl} - mock.recorder = &MockClockMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockClock) EXPECT() *MockClockMockRecorder { - return m.recorder -} - -// After mocks base method. -func (m *MockClock) After(arg0 time.Duration) <-chan time.Time { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "After", arg0) - ret0, _ := ret[0].(<-chan time.Time) - return ret0 -} - -// After indicates an expected call of After. -func (mr *MockClockMockRecorder) After(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "After", reflect.TypeOf((*MockClock)(nil).After), arg0) -} - -// AfterFunc mocks base method. -func (m *MockClock) AfterFunc(arg0 time.Duration, arg1 func()) clock.Timer { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "AfterFunc", arg0, arg1) - ret0, _ := ret[0].(clock.Timer) - return ret0 -} - -// AfterFunc indicates an expected call of AfterFunc. -func (mr *MockClockMockRecorder) AfterFunc(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AfterFunc", reflect.TypeOf((*MockClock)(nil).AfterFunc), arg0, arg1) -} - -// NewTicker mocks base method. -func (m *MockClock) NewTicker(arg0 time.Duration) clock.Ticker { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NewTicker", arg0) - ret0, _ := ret[0].(clock.Ticker) - return ret0 -} - -// NewTicker indicates an expected call of NewTicker. -func (mr *MockClockMockRecorder) NewTicker(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewTicker", reflect.TypeOf((*MockClock)(nil).NewTicker), arg0) -} - -// Now mocks base method. -func (m *MockClock) Now() time.Time { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Now") - ret0, _ := ret[0].(time.Time) - return ret0 -} - -// Now indicates an expected call of Now. -func (mr *MockClockMockRecorder) Now() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Now", reflect.TypeOf((*MockClock)(nil).Now)) -} - -// NowProto mocks base method. -func (m *MockClock) NowProto() *timestamppb.Timestamp { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "NowProto") - ret0, _ := ret[0].(*timestamppb.Timestamp) - return ret0 -} - -// NowProto indicates an expected call of NowProto. -func (mr *MockClockMockRecorder) NowProto() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NowProto", reflect.TypeOf((*MockClock)(nil).NowProto)) -} - -// Since mocks base method. -func (m *MockClock) Since(arg0 time.Time) time.Duration { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Since", arg0) - ret0, _ := ret[0].(time.Duration) - return ret0 -} - -// Since indicates an expected call of Since. -func (mr *MockClockMockRecorder) Since(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Since", reflect.TypeOf((*MockClock)(nil).Since), arg0) -} - -// Sleep mocks base method. -func (m *MockClock) Sleep(arg0 time.Duration) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "Sleep", arg0) -} - -// Sleep indicates an expected call of Sleep. -func (mr *MockClockMockRecorder) Sleep(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sleep", reflect.TypeOf((*MockClock)(nil).Sleep), arg0) -} - -// MockTicker is a mock of Ticker interface. -type MockTicker struct { - ctrl *gomock.Controller - recorder *MockTickerMockRecorder -} - -// MockTickerMockRecorder is the mock recorder for MockTicker. -type MockTickerMockRecorder struct { - mock *MockTicker -} - -// NewMockTicker creates a new mock instance. -func NewMockTicker(ctrl *gomock.Controller) *MockTicker { - mock := &MockTicker{ctrl: ctrl} - mock.recorder = &MockTickerMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockTicker) EXPECT() *MockTickerMockRecorder { - return m.recorder -} - -// C mocks base method. -func (m *MockTicker) C() <-chan time.Time { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "C") - ret0, _ := ret[0].(<-chan time.Time) - return ret0 -} - -// C indicates an expected call of C. -func (mr *MockTickerMockRecorder) C() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "C", reflect.TypeOf((*MockTicker)(nil).C)) -} - -// Stop mocks base method. -func (m *MockTicker) Stop() { - m.ctrl.T.Helper() - m.ctrl.Call(m, "Stop") -} - -// Stop indicates an expected call of Stop. -func (mr *MockTickerMockRecorder) Stop() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stop", reflect.TypeOf((*MockTicker)(nil).Stop)) -}