From 7f50c34920a154285e6bdf3962b9ca77e3bc5c0a Mon Sep 17 00:00:00 2001 From: Brian Conway Date: Mon, 18 Sep 2023 12:06:46 -0500 Subject: [PATCH] Update gomock to v0.3.0 - Sync `vendor/` for updated dependencies. - All test variations pass. --- Makefile | 2 + go.mod | 10 +-- go.sum | 20 ++--- .../accumulator/mock_datapointer_test.go | 9 +- .../alerter/mock_alarmer_test.go | 15 ++-- .../atlas-api/api/mock_respwriter_test.go | 11 ++- internal/atlas-api/lora/mock_loraer.go | 15 ++-- .../atlas-api/service/mock_alarmer_test.go | 17 ++-- .../atlas-api/service/mock_alerter_test.go | 9 +- .../service/mock_datapointer_test.go | 11 ++- .../atlas-api/service/mock_devicer_test.go | 17 ++-- .../atlas-api/service/mock_eventer_test.go | 11 ++- internal/atlas-api/service/mock_keyer_test.go | 13 ++- internal/atlas-api/service/mock_orger_test.go | 17 ++-- internal/atlas-api/service/mock_ruler_test.go | 17 ++-- .../atlas-api/service/mock_tagger_test.go | 9 +- .../atlas-api/service/mock_userer_test.go | 21 +++-- .../decoder/mock_devicer_test.go | 9 +- .../atlas-eventer/eventer/mock_ruler_test.go | 11 ++- .../validator/mock_devicer_test.go | 9 +- pkg/cache/mock_cacher.go | 25 +++--- pkg/notify/mock_notifier.go | 17 ++-- pkg/queue/mock_queuer.go | 13 ++- pkg/test/matcher/mock_protoer_test.go | 9 +- pkg/test/matcher/mock_recenter_test.go | 9 +- vendor/go.uber.org/mock/gomock/call.go | 83 ++++++++++++++----- vendor/go.uber.org/mock/gomock/callset.go | 6 +- vendor/go.uber.org/mock/gomock/controller.go | 42 ++++------ vendor/go.uber.org/mock/gomock/doc.go | 2 +- vendor/go.uber.org/mock/gomock/matchers.go | 62 +++++++++----- vendor/google.golang.org/grpc/call.go | 5 -- vendor/google.golang.org/grpc/clientconn.go | 38 ++++++--- vendor/google.golang.org/grpc/stream.go | 15 ++-- vendor/google.golang.org/grpc/version.go | 2 +- vendor/modules.txt | 12 +-- 35 files changed, 385 insertions(+), 208 deletions(-) diff --git a/Makefile b/Makefile index f54daecf..388ac24f 100644 --- a/Makefile +++ b/Makefile @@ -68,3 +68,5 @@ generate: go install go.uber.org/mock/mockgen@latest mockgen -version go generate -x ./... + find . -type f -name 'mock_*.go' -exec sh -c \ + 'echo "//lint:file-ignore ST1000 Mockgen package comment" >> {}' \; diff --git a/go.mod b/go.mod index ea2fc6c8..2eaf58d5 100644 --- a/go.mod +++ b/go.mod @@ -18,9 +18,9 @@ require ( github.com/smira/go-statsd v1.3.2 github.com/stretchr/testify v1.8.4 github.com/thingspect/api/go v1.0.14 - go.uber.org/mock v0.2.0 + go.uber.org/mock v0.3.0 golang.org/x/crypto v0.13.0 - google.golang.org/grpc v1.58.0 + google.golang.org/grpc v1.58.1 google.golang.org/protobuf v1.31.0 ) @@ -40,8 +40,8 @@ require ( golang.org/x/sync v0.3.0 // indirect golang.org/x/sys v0.12.0 // indirect golang.org/x/text v0.13.0 // indirect - google.golang.org/genproto v0.0.0-20230911183012-2d3300fd4832 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230911183012-2d3300fd4832 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230911183012-2d3300fd4832 // indirect + google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index f8ed17ba..99545306 100644 --- a/go.sum +++ b/go.sum @@ -636,8 +636,8 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= -go.uber.org/mock v0.2.0 h1:TaP3xedm7JaAgScZO7tlvlKrqT0p7I6OsdGB5YNSMDU= -go.uber.org/mock v0.2.0/go.mod h1:J0y0rp9L3xiff1+ZBfKxlC1fz2+aO16tw0tsDOixfuM= +go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo= +go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -1107,12 +1107,12 @@ google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZV google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230911183012-2d3300fd4832 h1:/30npZKtUjXqju7ZA2MsvpkGKD4mQFtf+zPnZasABjg= -google.golang.org/genproto v0.0.0-20230911183012-2d3300fd4832/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= -google.golang.org/genproto/googleapis/api v0.0.0-20230911183012-2d3300fd4832 h1:4E7rZzBdR5LmiZx6n47Dg4AjH8JLhMQWywsYqvXNLcs= -google.golang.org/genproto/googleapis/api v0.0.0-20230911183012-2d3300fd4832/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230911183012-2d3300fd4832 h1:o4LtQxebKIJ4vkzyhtD2rfUNZ20Zf0ik5YVP5E7G7VE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230911183012-2d3300fd4832/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb h1:XFBgcDwm7irdHTbz4Zk2h7Mh+eis4nfJEFQFYzJzuIA= +google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= +google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb h1:lK0oleSc7IQsUxO3U5TjL9DWlsxpEBemh+zpB7IqhWI= +google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb h1:Isk1sSH7bovx8Rti2wZK0UZF6oraBDK74uoyLEEVFN0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1151,8 +1151,8 @@ google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCD google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= -google.golang.org/grpc v1.58.0 h1:32JY8YpPMSR45K+c3o6b8VL73V+rR8k+DeMIr4vRH8o= -google.golang.org/grpc v1.58.0/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.58.1 h1:OL+Vz23DTtrrldqHK49FUOPHyY75rvFqJfXC84NYW58= +google.golang.org/grpc v1.58.1/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0/go.mod h1:Dk1tviKTvMCz5tvh7t+fh94dhmQVHuCt2OzJB3CTW9Y= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= diff --git a/internal/atlas-accumulator/accumulator/mock_datapointer_test.go b/internal/atlas-accumulator/accumulator/mock_datapointer_test.go index 5a6627b5..41f5a6f0 100644 --- a/internal/atlas-accumulator/accumulator/mock_datapointer_test.go +++ b/internal/atlas-accumulator/accumulator/mock_datapointer_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: accumulator.go - +// +// Generated by this command: +// +// mockgen -source accumulator.go -destination mock_datapointer_test.go -package accumulator +// // Package accumulator is a generated GoMock package. package accumulator @@ -44,7 +48,8 @@ func (m *Mockdatapointer) Create(ctx context.Context, point *common.DataPoint, o } // Create indicates an expected call of Create. -func (mr *MockdatapointerMockRecorder) Create(ctx, point, orgID interface{}) *gomock.Call { +func (mr *MockdatapointerMockRecorder) Create(ctx, point, orgID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*Mockdatapointer)(nil).Create), ctx, point, orgID) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/internal/atlas-alerter/alerter/mock_alarmer_test.go b/internal/atlas-alerter/alerter/mock_alarmer_test.go index 12cddeab..74665800 100644 --- a/internal/atlas-alerter/alerter/mock_alarmer_test.go +++ b/internal/atlas-alerter/alerter/mock_alarmer_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: alerter.go - +// +// Generated by this command: +// +// mockgen -source alerter.go -destination mock_alarmer_test.go -package alerter +// // Package alerter is a generated GoMock package. package alerter @@ -46,7 +50,7 @@ func (m *Mockorger) Read(ctx context.Context, orgID string) (*api.Org, error) { } // Read indicates an expected call of Read. -func (mr *MockorgerMockRecorder) Read(ctx, orgID interface{}) *gomock.Call { +func (mr *MockorgerMockRecorder) Read(ctx, orgID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*Mockorger)(nil).Read), ctx, orgID) } @@ -85,7 +89,7 @@ func (m *Mockalarmer) List(ctx context.Context, orgID string, lBoundTS time.Time } // List indicates an expected call of List. -func (mr *MockalarmerMockRecorder) List(ctx, orgID, lBoundTS, prevID, limit, ruleID interface{}) *gomock.Call { +func (mr *MockalarmerMockRecorder) List(ctx, orgID, lBoundTS, prevID, limit, ruleID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*Mockalarmer)(nil).List), ctx, orgID, lBoundTS, prevID, limit, ruleID) } @@ -123,7 +127,7 @@ func (m *Mockuserer) ListByTags(ctx context.Context, orgID string, tags []string } // ListByTags indicates an expected call of ListByTags. -func (mr *MockusererMockRecorder) ListByTags(ctx, orgID, tags interface{}) *gomock.Call { +func (mr *MockusererMockRecorder) ListByTags(ctx, orgID, tags any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListByTags", reflect.TypeOf((*Mockuserer)(nil).ListByTags), ctx, orgID, tags) } @@ -160,7 +164,8 @@ func (m *Mockalerter) Create(ctx context.Context, alert *api.Alert) error { } // Create indicates an expected call of Create. -func (mr *MockalerterMockRecorder) Create(ctx, alert interface{}) *gomock.Call { +func (mr *MockalerterMockRecorder) Create(ctx, alert any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*Mockalerter)(nil).Create), ctx, alert) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/internal/atlas-api/api/mock_respwriter_test.go b/internal/atlas-api/api/mock_respwriter_test.go index d7374e6f..a26609c0 100644 --- a/internal/atlas-api/api/mock_respwriter_test.go +++ b/internal/atlas-api/api/mock_respwriter_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: net/http (interfaces: ResponseWriter) - +// +// Generated by this command: +// +// mockgen -destination mock_respwriter_test.go -package api -build_flags=-mod=mod net/http ResponseWriter +// // Package api is a generated GoMock package. package api @@ -58,7 +62,7 @@ func (m *MockResponseWriter) Write(arg0 []byte) (int, error) { } // Write indicates an expected call of Write. -func (mr *MockResponseWriterMockRecorder) Write(arg0 interface{}) *gomock.Call { +func (mr *MockResponseWriterMockRecorder) Write(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockResponseWriter)(nil).Write), arg0) } @@ -70,7 +74,8 @@ func (m *MockResponseWriter) WriteHeader(arg0 int) { } // WriteHeader indicates an expected call of WriteHeader. -func (mr *MockResponseWriterMockRecorder) WriteHeader(arg0 interface{}) *gomock.Call { +func (mr *MockResponseWriterMockRecorder) WriteHeader(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteHeader", reflect.TypeOf((*MockResponseWriter)(nil).WriteHeader), arg0) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/internal/atlas-api/lora/mock_loraer.go b/internal/atlas-api/lora/mock_loraer.go index bdcf3067..85c53d85 100644 --- a/internal/atlas-api/lora/mock_loraer.go +++ b/internal/atlas-api/lora/mock_loraer.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: loraer.go - +// +// Generated by this command: +// +// mockgen -source loraer.go -destination mock_loraer.go -package lora +// // Package lora is a generated GoMock package. package lora @@ -43,7 +47,7 @@ func (m *MockLoraer) CreateDevice(ctx context.Context, uniqID, appKey string) er } // CreateDevice indicates an expected call of CreateDevice. -func (mr *MockLoraerMockRecorder) CreateDevice(ctx, uniqID, appKey interface{}) *gomock.Call { +func (mr *MockLoraerMockRecorder) CreateDevice(ctx, uniqID, appKey any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateDevice", reflect.TypeOf((*MockLoraer)(nil).CreateDevice), ctx, uniqID, appKey) } @@ -57,7 +61,7 @@ func (m *MockLoraer) CreateGateway(ctx context.Context, uniqID string) error { } // CreateGateway indicates an expected call of CreateGateway. -func (mr *MockLoraerMockRecorder) CreateGateway(ctx, uniqID interface{}) *gomock.Call { +func (mr *MockLoraerMockRecorder) CreateGateway(ctx, uniqID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateGateway", reflect.TypeOf((*MockLoraer)(nil).CreateGateway), ctx, uniqID) } @@ -71,7 +75,7 @@ func (m *MockLoraer) DeleteDevice(ctx context.Context, uniqID string) error { } // DeleteDevice indicates an expected call of DeleteDevice. -func (mr *MockLoraerMockRecorder) DeleteDevice(ctx, uniqID interface{}) *gomock.Call { +func (mr *MockLoraerMockRecorder) DeleteDevice(ctx, uniqID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteDevice", reflect.TypeOf((*MockLoraer)(nil).DeleteDevice), ctx, uniqID) } @@ -85,7 +89,8 @@ func (m *MockLoraer) DeleteGateway(ctx context.Context, uniqID string) error { } // DeleteGateway indicates an expected call of DeleteGateway. -func (mr *MockLoraerMockRecorder) DeleteGateway(ctx, uniqID interface{}) *gomock.Call { +func (mr *MockLoraerMockRecorder) DeleteGateway(ctx, uniqID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteGateway", reflect.TypeOf((*MockLoraer)(nil).DeleteGateway), ctx, uniqID) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/internal/atlas-api/service/mock_alarmer_test.go b/internal/atlas-api/service/mock_alarmer_test.go index 337d5521..7c919231 100644 --- a/internal/atlas-api/service/mock_alarmer_test.go +++ b/internal/atlas-api/service/mock_alarmer_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: alarm.go - +// +// Generated by this command: +// +// mockgen -source alarm.go -destination mock_alarmer_test.go -package service +// // Package service is a generated GoMock package. package service @@ -46,7 +50,7 @@ func (m *MockAlarmer) Create(ctx context.Context, alarm *api.Alarm) (*api.Alarm, } // Create indicates an expected call of Create. -func (mr *MockAlarmerMockRecorder) Create(ctx, alarm interface{}) *gomock.Call { +func (mr *MockAlarmerMockRecorder) Create(ctx, alarm any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockAlarmer)(nil).Create), ctx, alarm) } @@ -60,7 +64,7 @@ func (m *MockAlarmer) Delete(ctx context.Context, alarmID, orgID, ruleID string) } // Delete indicates an expected call of Delete. -func (mr *MockAlarmerMockRecorder) Delete(ctx, alarmID, orgID, ruleID interface{}) *gomock.Call { +func (mr *MockAlarmerMockRecorder) Delete(ctx, alarmID, orgID, ruleID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockAlarmer)(nil).Delete), ctx, alarmID, orgID, ruleID) } @@ -76,7 +80,7 @@ func (m *MockAlarmer) List(ctx context.Context, orgID string, lBoundTS time.Time } // List indicates an expected call of List. -func (mr *MockAlarmerMockRecorder) List(ctx, orgID, lBoundTS, prevID, limit, ruleID interface{}) *gomock.Call { +func (mr *MockAlarmerMockRecorder) List(ctx, orgID, lBoundTS, prevID, limit, ruleID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockAlarmer)(nil).List), ctx, orgID, lBoundTS, prevID, limit, ruleID) } @@ -91,7 +95,7 @@ func (m *MockAlarmer) Read(ctx context.Context, alarmID, orgID, ruleID string) ( } // Read indicates an expected call of Read. -func (mr *MockAlarmerMockRecorder) Read(ctx, alarmID, orgID, ruleID interface{}) *gomock.Call { +func (mr *MockAlarmerMockRecorder) Read(ctx, alarmID, orgID, ruleID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockAlarmer)(nil).Read), ctx, alarmID, orgID, ruleID) } @@ -106,7 +110,8 @@ func (m *MockAlarmer) Update(ctx context.Context, alarm *api.Alarm) (*api.Alarm, } // Update indicates an expected call of Update. -func (mr *MockAlarmerMockRecorder) Update(ctx, alarm interface{}) *gomock.Call { +func (mr *MockAlarmerMockRecorder) Update(ctx, alarm any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockAlarmer)(nil).Update), ctx, alarm) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/internal/atlas-api/service/mock_alerter_test.go b/internal/atlas-api/service/mock_alerter_test.go index 81602a76..7dcaf428 100644 --- a/internal/atlas-api/service/mock_alerter_test.go +++ b/internal/atlas-api/service/mock_alerter_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: alert.go - +// +// Generated by this command: +// +// mockgen -source alert.go -destination mock_alerter_test.go -package service +// // Package service is a generated GoMock package. package service @@ -46,7 +50,8 @@ func (m *MockAlerter) List(ctx context.Context, orgID, uniqID, devID, alarmID, u } // List indicates an expected call of List. -func (mr *MockAlerterMockRecorder) List(ctx, orgID, uniqID, devID, alarmID, userID, end, start interface{}) *gomock.Call { +func (mr *MockAlerterMockRecorder) List(ctx, orgID, uniqID, devID, alarmID, userID, end, start any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockAlerter)(nil).List), ctx, orgID, uniqID, devID, alarmID, userID, end, start) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/internal/atlas-api/service/mock_datapointer_test.go b/internal/atlas-api/service/mock_datapointer_test.go index eaa777f4..2fe74f0a 100644 --- a/internal/atlas-api/service/mock_datapointer_test.go +++ b/internal/atlas-api/service/mock_datapointer_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: datapoint.go - +// +// Generated by this command: +// +// mockgen -source datapoint.go -destination mock_datapointer_test.go -package service +// // Package service is a generated GoMock package. package service @@ -46,7 +50,7 @@ func (m *MockDataPointer) Latest(ctx context.Context, orgID, uniqID, devID strin } // Latest indicates an expected call of Latest. -func (mr *MockDataPointerMockRecorder) Latest(ctx, orgID, uniqID, devID, start interface{}) *gomock.Call { +func (mr *MockDataPointerMockRecorder) Latest(ctx, orgID, uniqID, devID, start any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Latest", reflect.TypeOf((*MockDataPointer)(nil).Latest), ctx, orgID, uniqID, devID, start) } @@ -61,7 +65,8 @@ func (m *MockDataPointer) List(ctx context.Context, orgID, uniqID, devID, attr s } // List indicates an expected call of List. -func (mr *MockDataPointerMockRecorder) List(ctx, orgID, uniqID, devID, attr, end, start interface{}) *gomock.Call { +func (mr *MockDataPointerMockRecorder) List(ctx, orgID, uniqID, devID, attr, end, start any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockDataPointer)(nil).List), ctx, orgID, uniqID, devID, attr, end, start) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/internal/atlas-api/service/mock_devicer_test.go b/internal/atlas-api/service/mock_devicer_test.go index 8d8685f2..94413830 100644 --- a/internal/atlas-api/service/mock_devicer_test.go +++ b/internal/atlas-api/service/mock_devicer_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: device.go - +// +// Generated by this command: +// +// mockgen -source device.go -destination mock_devicer_test.go -package service +// // Package service is a generated GoMock package. package service @@ -46,7 +50,7 @@ func (m *MockDevicer) Create(ctx context.Context, dev *api.Device) (*api.Device, } // Create indicates an expected call of Create. -func (mr *MockDevicerMockRecorder) Create(ctx, dev interface{}) *gomock.Call { +func (mr *MockDevicerMockRecorder) Create(ctx, dev any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockDevicer)(nil).Create), ctx, dev) } @@ -60,7 +64,7 @@ func (m *MockDevicer) Delete(ctx context.Context, devID, orgID string) error { } // Delete indicates an expected call of Delete. -func (mr *MockDevicerMockRecorder) Delete(ctx, devID, orgID interface{}) *gomock.Call { +func (mr *MockDevicerMockRecorder) Delete(ctx, devID, orgID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockDevicer)(nil).Delete), ctx, devID, orgID) } @@ -76,7 +80,7 @@ func (m *MockDevicer) List(ctx context.Context, orgID string, lBoundTS time.Time } // List indicates an expected call of List. -func (mr *MockDevicerMockRecorder) List(ctx, orgID, lBoundTS, prevID, limit, tag interface{}) *gomock.Call { +func (mr *MockDevicerMockRecorder) List(ctx, orgID, lBoundTS, prevID, limit, tag any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockDevicer)(nil).List), ctx, orgID, lBoundTS, prevID, limit, tag) } @@ -91,7 +95,7 @@ func (m *MockDevicer) Read(ctx context.Context, devID, orgID string) (*api.Devic } // Read indicates an expected call of Read. -func (mr *MockDevicerMockRecorder) Read(ctx, devID, orgID interface{}) *gomock.Call { +func (mr *MockDevicerMockRecorder) Read(ctx, devID, orgID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockDevicer)(nil).Read), ctx, devID, orgID) } @@ -106,7 +110,8 @@ func (m *MockDevicer) Update(ctx context.Context, dev *api.Device) (*api.Device, } // Update indicates an expected call of Update. -func (mr *MockDevicerMockRecorder) Update(ctx, dev interface{}) *gomock.Call { +func (mr *MockDevicerMockRecorder) Update(ctx, dev any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockDevicer)(nil).Update), ctx, dev) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/internal/atlas-api/service/mock_eventer_test.go b/internal/atlas-api/service/mock_eventer_test.go index 37d9425d..8fbf23e1 100644 --- a/internal/atlas-api/service/mock_eventer_test.go +++ b/internal/atlas-api/service/mock_eventer_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: event.go - +// +// Generated by this command: +// +// mockgen -source event.go -destination mock_eventer_test.go -package service +// // Package service is a generated GoMock package. package service @@ -46,7 +50,7 @@ func (m *MockEventer) Latest(ctx context.Context, orgID, ruleID string) ([]*api. } // Latest indicates an expected call of Latest. -func (mr *MockEventerMockRecorder) Latest(ctx, orgID, ruleID interface{}) *gomock.Call { +func (mr *MockEventerMockRecorder) Latest(ctx, orgID, ruleID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Latest", reflect.TypeOf((*MockEventer)(nil).Latest), ctx, orgID, ruleID) } @@ -61,7 +65,8 @@ func (m *MockEventer) List(ctx context.Context, orgID, uniqID, devID, ruleID str } // List indicates an expected call of List. -func (mr *MockEventerMockRecorder) List(ctx, orgID, uniqID, devID, ruleID, end, start interface{}) *gomock.Call { +func (mr *MockEventerMockRecorder) List(ctx, orgID, uniqID, devID, ruleID, end, start any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockEventer)(nil).List), ctx, orgID, uniqID, devID, ruleID, end, start) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/internal/atlas-api/service/mock_keyer_test.go b/internal/atlas-api/service/mock_keyer_test.go index 6324d4ec..cd3afd36 100644 --- a/internal/atlas-api/service/mock_keyer_test.go +++ b/internal/atlas-api/service/mock_keyer_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: session.go - +// +// Generated by this command: +// +// mockgen -source session.go -destination mock_keyer_test.go -package service +// // Package service is a generated GoMock package. package service @@ -46,7 +50,7 @@ func (m *MockKeyer) Create(ctx context.Context, key *api.Key) (*api.Key, error) } // Create indicates an expected call of Create. -func (mr *MockKeyerMockRecorder) Create(ctx, key interface{}) *gomock.Call { +func (mr *MockKeyerMockRecorder) Create(ctx, key any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockKeyer)(nil).Create), ctx, key) } @@ -60,7 +64,7 @@ func (m *MockKeyer) Delete(ctx context.Context, keyID, orgID string) error { } // Delete indicates an expected call of Delete. -func (mr *MockKeyerMockRecorder) Delete(ctx, keyID, orgID interface{}) *gomock.Call { +func (mr *MockKeyerMockRecorder) Delete(ctx, keyID, orgID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockKeyer)(nil).Delete), ctx, keyID, orgID) } @@ -76,7 +80,8 @@ func (m *MockKeyer) List(ctx context.Context, orgID string, lBoundTS time.Time, } // List indicates an expected call of List. -func (mr *MockKeyerMockRecorder) List(ctx, orgID, lBoundTS, prevID, limit interface{}) *gomock.Call { +func (mr *MockKeyerMockRecorder) List(ctx, orgID, lBoundTS, prevID, limit any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockKeyer)(nil).List), ctx, orgID, lBoundTS, prevID, limit) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/internal/atlas-api/service/mock_orger_test.go b/internal/atlas-api/service/mock_orger_test.go index 0a35a1d3..4b769ec2 100644 --- a/internal/atlas-api/service/mock_orger_test.go +++ b/internal/atlas-api/service/mock_orger_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: org.go - +// +// Generated by this command: +// +// mockgen -source org.go -destination mock_orger_test.go -package service +// // Package service is a generated GoMock package. package service @@ -46,7 +50,7 @@ func (m *MockOrger) Create(ctx context.Context, org *api.Org) (*api.Org, error) } // Create indicates an expected call of Create. -func (mr *MockOrgerMockRecorder) Create(ctx, org interface{}) *gomock.Call { +func (mr *MockOrgerMockRecorder) Create(ctx, org any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockOrger)(nil).Create), ctx, org) } @@ -60,7 +64,7 @@ func (m *MockOrger) Delete(ctx context.Context, orgID string) error { } // Delete indicates an expected call of Delete. -func (mr *MockOrgerMockRecorder) Delete(ctx, orgID interface{}) *gomock.Call { +func (mr *MockOrgerMockRecorder) Delete(ctx, orgID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockOrger)(nil).Delete), ctx, orgID) } @@ -76,7 +80,7 @@ func (m *MockOrger) List(ctx context.Context, lBoundTS time.Time, prevID string, } // List indicates an expected call of List. -func (mr *MockOrgerMockRecorder) List(ctx, lBoundTS, prevID, limit interface{}) *gomock.Call { +func (mr *MockOrgerMockRecorder) List(ctx, lBoundTS, prevID, limit any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockOrger)(nil).List), ctx, lBoundTS, prevID, limit) } @@ -91,7 +95,7 @@ func (m *MockOrger) Read(ctx context.Context, orgID string) (*api.Org, error) { } // Read indicates an expected call of Read. -func (mr *MockOrgerMockRecorder) Read(ctx, orgID interface{}) *gomock.Call { +func (mr *MockOrgerMockRecorder) Read(ctx, orgID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockOrger)(nil).Read), ctx, orgID) } @@ -106,7 +110,8 @@ func (m *MockOrger) Update(ctx context.Context, org *api.Org) (*api.Org, error) } // Update indicates an expected call of Update. -func (mr *MockOrgerMockRecorder) Update(ctx, org interface{}) *gomock.Call { +func (mr *MockOrgerMockRecorder) Update(ctx, org any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockOrger)(nil).Update), ctx, org) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/internal/atlas-api/service/mock_ruler_test.go b/internal/atlas-api/service/mock_ruler_test.go index eb7ab15c..3c26926a 100644 --- a/internal/atlas-api/service/mock_ruler_test.go +++ b/internal/atlas-api/service/mock_ruler_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: rule.go - +// +// Generated by this command: +// +// mockgen -source rule.go -destination mock_ruler_test.go -package service +// // Package service is a generated GoMock package. package service @@ -46,7 +50,7 @@ func (m *MockRuler) Create(ctx context.Context, rule *api.Rule) (*api.Rule, erro } // Create indicates an expected call of Create. -func (mr *MockRulerMockRecorder) Create(ctx, rule interface{}) *gomock.Call { +func (mr *MockRulerMockRecorder) Create(ctx, rule any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockRuler)(nil).Create), ctx, rule) } @@ -60,7 +64,7 @@ func (m *MockRuler) Delete(ctx context.Context, ruleID, orgID string) error { } // Delete indicates an expected call of Delete. -func (mr *MockRulerMockRecorder) Delete(ctx, ruleID, orgID interface{}) *gomock.Call { +func (mr *MockRulerMockRecorder) Delete(ctx, ruleID, orgID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockRuler)(nil).Delete), ctx, ruleID, orgID) } @@ -76,7 +80,7 @@ func (m *MockRuler) List(ctx context.Context, orgID string, lBoundTS time.Time, } // List indicates an expected call of List. -func (mr *MockRulerMockRecorder) List(ctx, orgID, lBoundTS, prevID, limit interface{}) *gomock.Call { +func (mr *MockRulerMockRecorder) List(ctx, orgID, lBoundTS, prevID, limit any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockRuler)(nil).List), ctx, orgID, lBoundTS, prevID, limit) } @@ -91,7 +95,7 @@ func (m *MockRuler) Read(ctx context.Context, ruleID, orgID string) (*api.Rule, } // Read indicates an expected call of Read. -func (mr *MockRulerMockRecorder) Read(ctx, ruleID, orgID interface{}) *gomock.Call { +func (mr *MockRulerMockRecorder) Read(ctx, ruleID, orgID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockRuler)(nil).Read), ctx, ruleID, orgID) } @@ -106,7 +110,8 @@ func (m *MockRuler) Update(ctx context.Context, rule *api.Rule) (*api.Rule, erro } // Update indicates an expected call of Update. -func (mr *MockRulerMockRecorder) Update(ctx, rule interface{}) *gomock.Call { +func (mr *MockRulerMockRecorder) Update(ctx, rule any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockRuler)(nil).Update), ctx, rule) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/internal/atlas-api/service/mock_tagger_test.go b/internal/atlas-api/service/mock_tagger_test.go index 995a68a0..3957e22e 100644 --- a/internal/atlas-api/service/mock_tagger_test.go +++ b/internal/atlas-api/service/mock_tagger_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: tag.go - +// +// Generated by this command: +// +// mockgen -source tag.go -destination mock_tagger_test.go -package service +// // Package service is a generated GoMock package. package service @@ -44,7 +48,8 @@ func (m *MockTagger) List(ctx context.Context, orgID string) ([]string, error) { } // List indicates an expected call of List. -func (mr *MockTaggerMockRecorder) List(ctx, orgID interface{}) *gomock.Call { +func (mr *MockTaggerMockRecorder) List(ctx, orgID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockTagger)(nil).List), ctx, orgID) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/internal/atlas-api/service/mock_userer_test.go b/internal/atlas-api/service/mock_userer_test.go index 05a6a958..d9ca7580 100644 --- a/internal/atlas-api/service/mock_userer_test.go +++ b/internal/atlas-api/service/mock_userer_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: user.go - +// +// Generated by this command: +// +// mockgen -source user.go -destination mock_userer_test.go -package service +// // Package service is a generated GoMock package. package service @@ -46,7 +50,7 @@ func (m *MockUserer) Create(ctx context.Context, user *api.User) (*api.User, err } // Create indicates an expected call of Create. -func (mr *MockUsererMockRecorder) Create(ctx, user interface{}) *gomock.Call { +func (mr *MockUsererMockRecorder) Create(ctx, user any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockUserer)(nil).Create), ctx, user) } @@ -60,7 +64,7 @@ func (m *MockUserer) Delete(ctx context.Context, userID, orgID string) error { } // Delete indicates an expected call of Delete. -func (mr *MockUsererMockRecorder) Delete(ctx, userID, orgID interface{}) *gomock.Call { +func (mr *MockUsererMockRecorder) Delete(ctx, userID, orgID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockUserer)(nil).Delete), ctx, userID, orgID) } @@ -76,7 +80,7 @@ func (m *MockUserer) List(ctx context.Context, orgID string, lBoundTS time.Time, } // List indicates an expected call of List. -func (mr *MockUsererMockRecorder) List(ctx, orgID, lBoundTS, prevID, limit, tag interface{}) *gomock.Call { +func (mr *MockUsererMockRecorder) List(ctx, orgID, lBoundTS, prevID, limit, tag any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockUserer)(nil).List), ctx, orgID, lBoundTS, prevID, limit, tag) } @@ -91,7 +95,7 @@ func (m *MockUserer) Read(ctx context.Context, userID, orgID string) (*api.User, } // Read indicates an expected call of Read. -func (mr *MockUsererMockRecorder) Read(ctx, userID, orgID interface{}) *gomock.Call { +func (mr *MockUsererMockRecorder) Read(ctx, userID, orgID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockUserer)(nil).Read), ctx, userID, orgID) } @@ -107,7 +111,7 @@ func (m *MockUserer) ReadByEmail(ctx context.Context, email, orgName string) (*a } // ReadByEmail indicates an expected call of ReadByEmail. -func (mr *MockUsererMockRecorder) ReadByEmail(ctx, email, orgName interface{}) *gomock.Call { +func (mr *MockUsererMockRecorder) ReadByEmail(ctx, email, orgName any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadByEmail", reflect.TypeOf((*MockUserer)(nil).ReadByEmail), ctx, email, orgName) } @@ -122,7 +126,7 @@ func (m *MockUserer) Update(ctx context.Context, user *api.User) (*api.User, err } // Update indicates an expected call of Update. -func (mr *MockUsererMockRecorder) Update(ctx, user interface{}) *gomock.Call { +func (mr *MockUsererMockRecorder) Update(ctx, user any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockUserer)(nil).Update), ctx, user) } @@ -136,7 +140,8 @@ func (m *MockUserer) UpdatePassword(ctx context.Context, userID, orgID string, p } // UpdatePassword indicates an expected call of UpdatePassword. -func (mr *MockUsererMockRecorder) UpdatePassword(ctx, userID, orgID, passHash interface{}) *gomock.Call { +func (mr *MockUsererMockRecorder) UpdatePassword(ctx, userID, orgID, passHash any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePassword", reflect.TypeOf((*MockUserer)(nil).UpdatePassword), ctx, userID, orgID, passHash) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/internal/atlas-decoder/decoder/mock_devicer_test.go b/internal/atlas-decoder/decoder/mock_devicer_test.go index dd927eb1..af46d1ef 100644 --- a/internal/atlas-decoder/decoder/mock_devicer_test.go +++ b/internal/atlas-decoder/decoder/mock_devicer_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: decoder.go - +// +// Generated by this command: +// +// mockgen -source decoder.go -destination mock_devicer_test.go -package decoder +// // Package decoder is a generated GoMock package. package decoder @@ -45,7 +49,8 @@ func (m *Mockdevicer) ReadByUniqID(ctx context.Context, uniqID string) (*api.Dev } // ReadByUniqID indicates an expected call of ReadByUniqID. -func (mr *MockdevicerMockRecorder) ReadByUniqID(ctx, uniqID interface{}) *gomock.Call { +func (mr *MockdevicerMockRecorder) ReadByUniqID(ctx, uniqID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadByUniqID", reflect.TypeOf((*Mockdevicer)(nil).ReadByUniqID), ctx, uniqID) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/internal/atlas-eventer/eventer/mock_ruler_test.go b/internal/atlas-eventer/eventer/mock_ruler_test.go index e8078f7e..63f0844d 100644 --- a/internal/atlas-eventer/eventer/mock_ruler_test.go +++ b/internal/atlas-eventer/eventer/mock_ruler_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: eventer.go - +// +// Generated by this command: +// +// mockgen -source eventer.go -destination mock_ruler_test.go -package eventer +// // Package eventer is a generated GoMock package. package eventer @@ -45,7 +49,7 @@ func (m *Mockruler) ListByTags(ctx context.Context, orgID, attr string, deviceTa } // ListByTags indicates an expected call of ListByTags. -func (mr *MockrulerMockRecorder) ListByTags(ctx, orgID, attr, deviceTags interface{}) *gomock.Call { +func (mr *MockrulerMockRecorder) ListByTags(ctx, orgID, attr, deviceTags any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListByTags", reflect.TypeOf((*Mockruler)(nil).ListByTags), ctx, orgID, attr, deviceTags) } @@ -82,7 +86,8 @@ func (m *Mockeventer) Create(ctx context.Context, event *api.Event) error { } // Create indicates an expected call of Create. -func (mr *MockeventerMockRecorder) Create(ctx, event interface{}) *gomock.Call { +func (mr *MockeventerMockRecorder) Create(ctx, event any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*Mockeventer)(nil).Create), ctx, event) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/internal/atlas-validator/validator/mock_devicer_test.go b/internal/atlas-validator/validator/mock_devicer_test.go index a34ebabc..362adc89 100644 --- a/internal/atlas-validator/validator/mock_devicer_test.go +++ b/internal/atlas-validator/validator/mock_devicer_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: validator.go - +// +// Generated by this command: +// +// mockgen -source validator.go -destination mock_devicer_test.go -package validator +// // Package validator is a generated GoMock package. package validator @@ -45,7 +49,8 @@ func (m *Mockdevicer) ReadByUniqID(ctx context.Context, uniqID string) (*api.Dev } // ReadByUniqID indicates an expected call of ReadByUniqID. -func (mr *MockdevicerMockRecorder) ReadByUniqID(ctx, uniqID interface{}) *gomock.Call { +func (mr *MockdevicerMockRecorder) ReadByUniqID(ctx, uniqID any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadByUniqID", reflect.TypeOf((*Mockdevicer)(nil).ReadByUniqID), ctx, uniqID) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/pkg/cache/mock_cacher.go b/pkg/cache/mock_cacher.go index 456fd244..301223fe 100644 --- a/pkg/cache/mock_cacher.go +++ b/pkg/cache/mock_cacher.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: cacher.go - +// +// Generated by this command: +// +// mockgen -source cacher.go -destination mock_cacher.go -package cache +// // Package cache is a generated GoMock package. package cache @@ -58,7 +62,7 @@ func (m *MockCacher) Del(ctx context.Context, key string) error { } // Del indicates an expected call of Del. -func (mr *MockCacherMockRecorder) Del(ctx, key interface{}) *gomock.Call { +func (mr *MockCacherMockRecorder) Del(ctx, key any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Del", reflect.TypeOf((*MockCacher)(nil).Del), ctx, key) } @@ -74,7 +78,7 @@ func (m *MockCacher) Get(ctx context.Context, key string) (bool, string, error) } // Get indicates an expected call of Get. -func (mr *MockCacherMockRecorder) Get(ctx, key interface{}) *gomock.Call { +func (mr *MockCacherMockRecorder) Get(ctx, key any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockCacher)(nil).Get), ctx, key) } @@ -90,7 +94,7 @@ func (m *MockCacher) GetB(ctx context.Context, key string) (bool, []byte, error) } // GetB indicates an expected call of GetB. -func (mr *MockCacherMockRecorder) GetB(ctx, key interface{}) *gomock.Call { +func (mr *MockCacherMockRecorder) GetB(ctx, key any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetB", reflect.TypeOf((*MockCacher)(nil).GetB), ctx, key) } @@ -106,7 +110,7 @@ func (m *MockCacher) GetI(ctx context.Context, key string) (bool, int64, error) } // GetI indicates an expected call of GetI. -func (mr *MockCacherMockRecorder) GetI(ctx, key interface{}) *gomock.Call { +func (mr *MockCacherMockRecorder) GetI(ctx, key any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetI", reflect.TypeOf((*MockCacher)(nil).GetI), ctx, key) } @@ -121,7 +125,7 @@ func (m *MockCacher) Incr(ctx context.Context, key string) (int64, error) { } // Incr indicates an expected call of Incr. -func (mr *MockCacherMockRecorder) Incr(ctx, key interface{}) *gomock.Call { +func (mr *MockCacherMockRecorder) Incr(ctx, key any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Incr", reflect.TypeOf((*MockCacher)(nil).Incr), ctx, key) } @@ -135,7 +139,7 @@ func (m *MockCacher) Set(ctx context.Context, key string, value any) error { } // Set indicates an expected call of Set. -func (mr *MockCacherMockRecorder) Set(ctx, key, value interface{}) *gomock.Call { +func (mr *MockCacherMockRecorder) Set(ctx, key, value any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Set", reflect.TypeOf((*MockCacher)(nil).Set), ctx, key, value) } @@ -150,7 +154,7 @@ func (m *MockCacher) SetIfNotExist(ctx context.Context, key string, value any) ( } // SetIfNotExist indicates an expected call of SetIfNotExist. -func (mr *MockCacherMockRecorder) SetIfNotExist(ctx, key, value interface{}) *gomock.Call { +func (mr *MockCacherMockRecorder) SetIfNotExist(ctx, key, value any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetIfNotExist", reflect.TypeOf((*MockCacher)(nil).SetIfNotExist), ctx, key, value) } @@ -165,7 +169,7 @@ func (m *MockCacher) SetIfNotExistTTL(ctx context.Context, key string, value any } // SetIfNotExistTTL indicates an expected call of SetIfNotExistTTL. -func (mr *MockCacherMockRecorder) SetIfNotExistTTL(ctx, key, value, exp interface{}) *gomock.Call { +func (mr *MockCacherMockRecorder) SetIfNotExistTTL(ctx, key, value, exp any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetIfNotExistTTL", reflect.TypeOf((*MockCacher)(nil).SetIfNotExistTTL), ctx, key, value, exp) } @@ -179,7 +183,8 @@ func (m *MockCacher) SetTTL(ctx context.Context, key string, value any, exp time } // SetTTL indicates an expected call of SetTTL. -func (mr *MockCacherMockRecorder) SetTTL(ctx, key, value, exp interface{}) *gomock.Call { +func (mr *MockCacherMockRecorder) SetTTL(ctx, key, value, exp any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTTL", reflect.TypeOf((*MockCacher)(nil).SetTTL), ctx, key, value, exp) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/pkg/notify/mock_notifier.go b/pkg/notify/mock_notifier.go index d86ef996..905a3de1 100644 --- a/pkg/notify/mock_notifier.go +++ b/pkg/notify/mock_notifier.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: notifier.go - +// +// Generated by this command: +// +// mockgen -source notifier.go -destination mock_notifier.go -package notify +// // Package notify is a generated GoMock package. package notify @@ -43,7 +47,7 @@ func (m *MockNotifier) App(ctx context.Context, userKey, subject, body string) e } // App indicates an expected call of App. -func (mr *MockNotifierMockRecorder) App(ctx, userKey, subject, body interface{}) *gomock.Call { +func (mr *MockNotifierMockRecorder) App(ctx, userKey, subject, body any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "App", reflect.TypeOf((*MockNotifier)(nil).App), ctx, userKey, subject, body) } @@ -57,7 +61,7 @@ func (m *MockNotifier) Email(ctx context.Context, displayName, from, to, subject } // Email indicates an expected call of Email. -func (mr *MockNotifierMockRecorder) Email(ctx, displayName, from, to, subject, body interface{}) *gomock.Call { +func (mr *MockNotifierMockRecorder) Email(ctx, displayName, from, to, subject, body any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Email", reflect.TypeOf((*MockNotifier)(nil).Email), ctx, displayName, from, to, subject, body) } @@ -71,7 +75,7 @@ func (m *MockNotifier) SMS(ctx context.Context, phone, subject, body string) err } // SMS indicates an expected call of SMS. -func (mr *MockNotifierMockRecorder) SMS(ctx, phone, subject, body interface{}) *gomock.Call { +func (mr *MockNotifierMockRecorder) SMS(ctx, phone, subject, body any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SMS", reflect.TypeOf((*MockNotifier)(nil).SMS), ctx, phone, subject, body) } @@ -85,7 +89,7 @@ func (m *MockNotifier) ValidateApp(userKey string) error { } // ValidateApp indicates an expected call of ValidateApp. -func (mr *MockNotifierMockRecorder) ValidateApp(userKey interface{}) *gomock.Call { +func (mr *MockNotifierMockRecorder) ValidateApp(userKey any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateApp", reflect.TypeOf((*MockNotifier)(nil).ValidateApp), userKey) } @@ -99,7 +103,8 @@ func (m *MockNotifier) ValidateSMS(ctx context.Context, phone string) error { } // ValidateSMS indicates an expected call of ValidateSMS. -func (mr *MockNotifierMockRecorder) ValidateSMS(ctx, phone interface{}) *gomock.Call { +func (mr *MockNotifierMockRecorder) ValidateSMS(ctx, phone any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateSMS", reflect.TypeOf((*MockNotifier)(nil).ValidateSMS), ctx, phone) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/pkg/queue/mock_queuer.go b/pkg/queue/mock_queuer.go index 0d08fa29..72326597 100644 --- a/pkg/queue/mock_queuer.go +++ b/pkg/queue/mock_queuer.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: queuer.go - +// +// Generated by this command: +// +// mockgen -source queuer.go -destination mock_queuer.go -package queue +// // Package queue is a generated GoMock package. package queue @@ -180,7 +184,7 @@ func (m *MockQueuer) Prime(topic string) error { } // Prime indicates an expected call of Prime. -func (mr *MockQueuerMockRecorder) Prime(topic interface{}) *gomock.Call { +func (mr *MockQueuerMockRecorder) Prime(topic any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Prime", reflect.TypeOf((*MockQueuer)(nil).Prime), topic) } @@ -194,7 +198,7 @@ func (m *MockQueuer) Publish(topic string, payload []byte) error { } // Publish indicates an expected call of Publish. -func (mr *MockQueuerMockRecorder) Publish(topic, payload interface{}) *gomock.Call { +func (mr *MockQueuerMockRecorder) Publish(topic, payload any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Publish", reflect.TypeOf((*MockQueuer)(nil).Publish), topic, payload) } @@ -209,7 +213,8 @@ func (m *MockQueuer) Subscribe(topic string) (Subber, error) { } // Subscribe indicates an expected call of Subscribe. -func (mr *MockQueuerMockRecorder) Subscribe(topic interface{}) *gomock.Call { +func (mr *MockQueuerMockRecorder) Subscribe(topic any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Subscribe", reflect.TypeOf((*MockQueuer)(nil).Subscribe), topic) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/pkg/test/matcher/mock_protoer_test.go b/pkg/test/matcher/mock_protoer_test.go index c1b05dcc..d0583321 100644 --- a/pkg/test/matcher/mock_protoer_test.go +++ b/pkg/test/matcher/mock_protoer_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: proto_test.go - +// +// Generated by this command: +// +// mockgen -source proto_test.go -destination mock_protoer_test.go -package matcher +// // Package matcher is a generated GoMock package. package matcher @@ -43,7 +47,8 @@ func (m *Mockprotoer) f(vIn *token.Web) error { } // f indicates an expected call of f. -func (mr *MockprotoerMockRecorder) f(vIn interface{}) *gomock.Call { +func (mr *MockprotoerMockRecorder) f(vIn any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "f", reflect.TypeOf((*Mockprotoer)(nil).f), vIn) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/pkg/test/matcher/mock_recenter_test.go b/pkg/test/matcher/mock_recenter_test.go index 3c74ac0e..a1e75f66 100644 --- a/pkg/test/matcher/mock_recenter_test.go +++ b/pkg/test/matcher/mock_recenter_test.go @@ -1,6 +1,10 @@ // Code generated by MockGen. DO NOT EDIT. // Source: recent_test.go - +// +// Generated by this command: +// +// mockgen -source recent_test.go -destination mock_recenter_test.go -package matcher +// // Package matcher is a generated GoMock package. package matcher @@ -43,7 +47,8 @@ func (m *Mockrecenter) f(t time.Time) error { } // f indicates an expected call of f. -func (mr *MockrecenterMockRecorder) f(t interface{}) *gomock.Call { +func (mr *MockrecenterMockRecorder) f(t any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "f", reflect.TypeOf((*Mockrecenter)(nil).f), t) } +//lint:file-ignore ST1000 Mockgen package comment diff --git a/vendor/go.uber.org/mock/gomock/call.go b/vendor/go.uber.org/mock/gomock/call.go index 98881596..e1ea8263 100644 --- a/vendor/go.uber.org/mock/gomock/call.go +++ b/vendor/go.uber.org/mock/gomock/call.go @@ -25,7 +25,7 @@ import ( type Call struct { t TestHelper // for triggering test failures on invalid call setup - receiver interface{} // the receiver of the method call + receiver any // the receiver of the method call method string // the name of the method methodType reflect.Type // the type of the method args []Matcher // the args @@ -41,12 +41,12 @@ type Call struct { // actions are called when this Call is called. Each action gets the args and // can set the return values by returning a non-nil slice. Actions run in the // order they are created. - actions []func([]interface{}) []interface{} + actions []func([]any) []any } // newCall creates a *Call. It requires the method type in order to support // unexported methods. -func newCall(t TestHelper, receiver interface{}, method string, methodType reflect.Type, args ...interface{}) *Call { +func newCall(t TestHelper, receiver any, method string, methodType reflect.Type, args ...any) *Call { t.Helper() // TODO: check arity, types. @@ -67,9 +67,9 @@ func newCall(t TestHelper, receiver interface{}, method string, methodType refle // and this line changes, i.e. this code is wrapped in another anonymous function. // 0 is us, 1 is RecordCallWithMethodType(), 2 is the generated recorder, and 3 is the user's test. origin := callerInfo(3) - actions := []func([]interface{}) []interface{}{func([]interface{}) []interface{} { + actions := []func([]any) []any{func([]any) []any { // Synthesize the zero value for each of the return args' types. - rets := make([]interface{}, methodType.NumOut()) + rets := make([]any, methodType.NumOut()) for i := 0; i < methodType.NumOut(); i++ { rets[i] = reflect.Zero(methodType.Out(i)).Interface() } @@ -107,13 +107,13 @@ func (c *Call) MaxTimes(n int) *Call { // DoAndReturn declares the action to run when the call is matched. // The return values from this function are returned by the mocked function. -// It takes an interface{} argument to support n-arity functions. +// It takes an any argument to support n-arity functions. // The anonymous function must match the function signature mocked method. -func (c *Call) DoAndReturn(f interface{}) *Call { +func (c *Call) DoAndReturn(f any) *Call { // TODO: Check arity and types here, rather than dying badly elsewhere. v := reflect.ValueOf(f) - c.addAction(func(args []interface{}) []interface{} { + c.addAction(func(args []any) []any { c.t.Helper() ft := v.Type() if c.methodType.NumIn() != ft.NumIn() { @@ -136,7 +136,7 @@ func (c *Call) DoAndReturn(f interface{}) *Call { } } vRets := v.Call(vArgs) - rets := make([]interface{}, len(vRets)) + rets := make([]any, len(vRets)) for i, ret := range vRets { rets[i] = ret.Interface() } @@ -148,13 +148,13 @@ func (c *Call) DoAndReturn(f interface{}) *Call { // Do declares the action to run when the call is matched. The function's // return values are ignored to retain backward compatibility. To use the // return values call DoAndReturn. -// It takes an interface{} argument to support n-arity functions. +// It takes an any argument to support n-arity functions. // The anonymous function must match the function signature mocked method. -func (c *Call) Do(f interface{}) *Call { +func (c *Call) Do(f any) *Call { // TODO: Check arity and types here, rather than dying badly elsewhere. v := reflect.ValueOf(f) - c.addAction(func(args []interface{}) []interface{} { + c.addAction(func(args []any) []any { c.t.Helper() ft := v.Type() if c.methodType.NumIn() != ft.NumIn() { @@ -183,7 +183,7 @@ func (c *Call) Do(f interface{}) *Call { } // Return declares the values to be returned by the mocked function call. -func (c *Call) Return(rets ...interface{}) *Call { +func (c *Call) Return(rets ...any) *Call { c.t.Helper() mt := c.methodType @@ -215,7 +215,7 @@ func (c *Call) Return(rets ...interface{}) *Call { } } - c.addAction(func([]interface{}) []interface{} { + c.addAction(func([]any) []any { return rets }) @@ -231,7 +231,7 @@ func (c *Call) Times(n int) *Call { // SetArg declares an action that will set the nth argument's value, // indirected through a pointer. Or, in the case of a slice and map, SetArg // will copy value's elements/key-value pairs into the nth argument. -func (c *Call) SetArg(n int, value interface{}) *Call { +func (c *Call) SetArg(n int, value any) *Call { c.t.Helper() mt := c.methodType @@ -262,7 +262,7 @@ func (c *Call) SetArg(n int, value interface{}) *Call { n, at, c.origin) } - c.addAction(func(args []interface{}) []interface{} { + c.addAction(func(args []any) []any { v := reflect.ValueOf(value) switch reflect.TypeOf(args[n]).Kind() { case reflect.Slice: @@ -323,7 +323,7 @@ func (c *Call) String() string { // Tests if the given call matches the expected call. // If yes, returns nil. If no, returns error with message explaining why it does not match. -func (c *Call) matches(args []interface{}) error { +func (c *Call) matches(args []any) error { if !c.methodType.IsVariadic() { if len(args) != len(c.args) { return fmt.Errorf("expected call at %s has the wrong number of arguments. Got: %d, want: %d", @@ -429,26 +429,63 @@ func (c *Call) dropPrereqs() (preReqs []*Call) { return } -func (c *Call) call() []func([]interface{}) []interface{} { +func (c *Call) call() []func([]any) []any { c.numCalls++ return c.actions } // InOrder declares that the given calls should occur in order. -func InOrder(calls ...*Call) { +// It panics if the type of any of the arguments isn't *Call or a generated +// mock with an embedded *Call. +func InOrder(args ...any) { + calls := make([]*Call, 0, len(args)) + for i := 0; i < len(args); i++ { + if call := getCall(args[i]); call != nil { + calls = append(calls, call) + continue + } + panic(fmt.Sprintf( + "invalid argument at position %d of type %T, InOrder expects *gomock.Call or generated mock types with an embedded *gomock.Call", + i, + args[i], + )) + } for i := 1; i < len(calls); i++ { calls[i].After(calls[i-1]) } } -func setSlice(arg interface{}, v reflect.Value) { +// getCall checks if the parameter is a *Call or a generated struct +// that wraps a *Call and returns the *Call pointer - if neither, it returns nil. +func getCall(arg any) *Call { + if call, ok := arg.(*Call); ok { + return call + } + t := reflect.ValueOf(arg) + if t.Kind() != reflect.Ptr && t.Kind() != reflect.Interface { + return nil + } + t = t.Elem() + for i := 0; i < t.NumField(); i++ { + f := t.Field(i) + if !f.CanInterface() { + continue + } + if call, ok := f.Interface().(*Call); ok { + return call + } + } + return nil +} + +func setSlice(arg any, v reflect.Value) { va := reflect.ValueOf(arg) for i := 0; i < v.Len(); i++ { va.Index(i).Set(v.Index(i)) } } -func setMap(arg interface{}, v reflect.Value) { +func setMap(arg any, v reflect.Value) { va := reflect.ValueOf(arg) for _, e := range va.MapKeys() { va.SetMapIndex(e, reflect.Value{}) @@ -458,11 +495,11 @@ func setMap(arg interface{}, v reflect.Value) { } } -func (c *Call) addAction(action func([]interface{}) []interface{}) { +func (c *Call) addAction(action func([]any) []any) { c.actions = append(c.actions, action) } -func formatGottenArg(m Matcher, arg interface{}) string { +func formatGottenArg(m Matcher, arg any) string { got := fmt.Sprintf("%v (%T)", arg, arg) if gs, ok := m.(GotFormatter); ok { got = gs.Got(arg) diff --git a/vendor/go.uber.org/mock/gomock/callset.go b/vendor/go.uber.org/mock/gomock/callset.go index f2131a14..f5cc592d 100644 --- a/vendor/go.uber.org/mock/gomock/callset.go +++ b/vendor/go.uber.org/mock/gomock/callset.go @@ -35,7 +35,7 @@ type callSet struct { // callSetKey is the key in the maps in callSet type callSetKey struct { - receiver interface{} + receiver any fname string } @@ -50,7 +50,7 @@ func newCallSet() *callSet { func newOverridableCallSet() *callSet { return &callSet{ expected: make(map[callSetKey][]*Call), - expectedMu: &sync.Mutex{}, + expectedMu: &sync.Mutex{}, exhausted: make(map[callSetKey][]*Call), allowOverride: true, } @@ -93,7 +93,7 @@ func (cs callSet) Remove(call *Call) { } // FindMatch searches for a matching call. Returns error with explanation message if no call matched. -func (cs callSet) FindMatch(receiver interface{}, method string, args []interface{}) (*Call, error) { +func (cs callSet) FindMatch(receiver any, method string, args []any) (*Call, error) { key := callSetKey{receiver, method} cs.expectedMu.Lock() diff --git a/vendor/go.uber.org/mock/gomock/controller.go b/vendor/go.uber.org/mock/gomock/controller.go index de904c8c..6846d0d0 100644 --- a/vendor/go.uber.org/mock/gomock/controller.go +++ b/vendor/go.uber.org/mock/gomock/controller.go @@ -25,8 +25,8 @@ import ( // A TestReporter is something that can be used to report test failures. It // is satisfied by the standard library's *testing.T. type TestReporter interface { - Errorf(format string, args ...interface{}) - Fatalf(format string, args ...interface{}) + Errorf(format string, args ...any) + Fatalf(format string, args ...any) } // TestHelper is a TestReporter that has the Helper method. It is satisfied @@ -53,19 +53,16 @@ type cleanuper interface { // // func TestFoo(t *testing.T) { // ctrl := gomock.NewController(t) -// defer ctrl.Finish() // // .. // } // // func TestBar(t *testing.T) { // t.Run("Sub-Test-1", st) { // ctrl := gomock.NewController(st) -// defer ctrl.Finish() // // .. // }) // t.Run("Sub-Test-2", st) { // ctrl := gomock.NewController(st) -// defer ctrl.Finish() // // .. // }) // }) @@ -81,11 +78,10 @@ type Controller struct { finished bool } -// NewController returns a new Controller. It is the preferred way to create a -// Controller. +// NewController returns a new Controller. It is the preferred way to create a Controller. // -// New in go1.14+, if you are passing a *testing.T into this function you no -// longer need to call ctrl.Finish() in your test methods. +// Passing [*testing.T] registers cleanup function to automatically call [Controller.Finish] +// when the test and all its subtests complete. func NewController(t TestReporter, opts ...ControllerOption) *Controller { h, ok := t.(TestHelper) if !ok { @@ -130,10 +126,10 @@ type cancelReporter struct { cancel func() } -func (r *cancelReporter) Errorf(format string, args ...interface{}) { +func (r *cancelReporter) Errorf(format string, args ...any) { r.t.Errorf(format, args...) } -func (r *cancelReporter) Fatalf(format string, args ...interface{}) { +func (r *cancelReporter) Fatalf(format string, args ...any) { defer r.cancel() r.t.Fatalf(format, args...) } @@ -158,17 +154,17 @@ type nopTestHelper struct { t TestReporter } -func (h *nopTestHelper) Errorf(format string, args ...interface{}) { +func (h *nopTestHelper) Errorf(format string, args ...any) { h.t.Errorf(format, args...) } -func (h *nopTestHelper) Fatalf(format string, args ...interface{}) { +func (h *nopTestHelper) Fatalf(format string, args ...any) { h.t.Fatalf(format, args...) } func (h nopTestHelper) Helper() {} // RecordCall is called by a mock. It should not be called by user code. -func (ctrl *Controller) RecordCall(receiver interface{}, method string, args ...interface{}) *Call { +func (ctrl *Controller) RecordCall(receiver any, method string, args ...any) *Call { ctrl.T.Helper() recv := reflect.ValueOf(receiver) @@ -182,7 +178,7 @@ func (ctrl *Controller) RecordCall(receiver interface{}, method string, args ... } // RecordCallWithMethodType is called by a mock. It should not be called by user code. -func (ctrl *Controller) RecordCallWithMethodType(receiver interface{}, method string, methodType reflect.Type, args ...interface{}) *Call { +func (ctrl *Controller) RecordCallWithMethodType(receiver any, method string, methodType reflect.Type, args ...any) *Call { ctrl.T.Helper() call := newCall(ctrl.T, receiver, method, methodType, args...) @@ -195,11 +191,11 @@ func (ctrl *Controller) RecordCallWithMethodType(receiver interface{}, method st } // Call is called by a mock. It should not be called by user code. -func (ctrl *Controller) Call(receiver interface{}, method string, args ...interface{}) []interface{} { +func (ctrl *Controller) Call(receiver any, method string, args ...any) []any { ctrl.T.Helper() // Nest this code so we can use defer to make sure the lock is released. - actions := func() []func([]interface{}) []interface{} { + actions := func() []func([]any) []any { ctrl.T.Helper() ctrl.mu.Lock() defer ctrl.mu.Unlock() @@ -228,7 +224,7 @@ func (ctrl *Controller) Call(receiver interface{}, method string, args ...interf return actions }() - var rets []interface{} + var rets []any for _, action := range actions { if r := action(args); r != nil { rets = r @@ -238,12 +234,8 @@ func (ctrl *Controller) Call(receiver interface{}, method string, args ...interf return rets } -// Finish checks to see if all the methods that were expected to be called -// were called. It should be invoked for each Controller. It is not idempotent -// and therefore can only be invoked once. -// -// New in go1.14+, if you are passing a *testing.T into NewController function you no -// longer need to call ctrl.Finish() in your test methods. +// Finish checks to see if all the methods that were expected to be called were called. +// It is not idempotent and therefore can only be invoked once. func (ctrl *Controller) Finish() { // If we're currently panicking, probably because this is a deferred call. // This must be recovered in the deferred function. @@ -257,7 +249,7 @@ func (ctrl *Controller) Satisfied() bool { return ctrl.expectedCalls.Satisfied() } -func (ctrl *Controller) finish(cleanup bool, panicErr interface{}) { +func (ctrl *Controller) finish(cleanup bool, panicErr any) { ctrl.T.Helper() ctrl.mu.Lock() diff --git a/vendor/go.uber.org/mock/gomock/doc.go b/vendor/go.uber.org/mock/gomock/doc.go index f1a304fb..696dda38 100644 --- a/vendor/go.uber.org/mock/gomock/doc.go +++ b/vendor/go.uber.org/mock/gomock/doc.go @@ -23,7 +23,7 @@ // (2) Use mockgen to generate a mock from the interface. // (3) Use the mock in a test: // func TestMyThing(t *testing.T) { -// mockCtrl := gomock.NewController(t)// +// mockCtrl := gomock.NewController(t) // mockObj := something.NewMockMyInterface(mockCtrl) // mockObj.EXPECT().SomeMethod(4, "blah") // // pass mockObj to a real object and play with it. diff --git a/vendor/go.uber.org/mock/gomock/matchers.go b/vendor/go.uber.org/mock/gomock/matchers.go index 6d5eff4f..bac4623b 100644 --- a/vendor/go.uber.org/mock/gomock/matchers.go +++ b/vendor/go.uber.org/mock/gomock/matchers.go @@ -24,7 +24,7 @@ import ( // It is used to represent the valid or expected arguments to a mocked method. type Matcher interface { // Matches returns whether x is a match. - Matches(x interface{}) bool + Matches(x any) bool // String describes what the matcher matches. String() string @@ -35,7 +35,7 @@ type Matcher interface { // printing . func WantFormatter(s fmt.Stringer, m Matcher) Matcher { type matcher interface { - Matches(x interface{}) bool + Matches(x any) bool } return struct { @@ -63,16 +63,16 @@ func (f StringerFunc) String() string { type GotFormatter interface { // Got is invoked with the received value. The result is used when // printing the failure message. - Got(got interface{}) string + Got(got any) string } // GotFormatterFunc type is an adapter to allow the use of ordinary // functions as a GotFormatter. If f is a function with the appropriate // signature, GotFormatterFunc(f) is a GotFormatter that calls f. -type GotFormatterFunc func(got interface{}) string +type GotFormatterFunc func(got any) string // Got implements GotFormatter. -func (f GotFormatterFunc) Got(got interface{}) string { +func (f GotFormatterFunc) Got(got any) string { return f(got) } @@ -89,7 +89,7 @@ func GotFormatterAdapter(s GotFormatter, m Matcher) Matcher { type anyMatcher struct{} -func (anyMatcher) Matches(interface{}) bool { +func (anyMatcher) Matches(any) bool { return true } @@ -97,11 +97,23 @@ func (anyMatcher) String() string { return "is anything" } +type condMatcher struct { + fn func(x any) bool +} + +func (c condMatcher) Matches(x any) bool { + return c.fn(x) +} + +func (condMatcher) String() string { + return "adheres to a custom condition" +} + type eqMatcher struct { - x interface{} + x any } -func (e eqMatcher) Matches(x interface{}) bool { +func (e eqMatcher) Matches(x any) bool { // In case, some value is nil if e.x == nil || x == nil { return reflect.DeepEqual(e.x, x) @@ -125,7 +137,7 @@ func (e eqMatcher) String() string { type nilMatcher struct{} -func (nilMatcher) Matches(x interface{}) bool { +func (nilMatcher) Matches(x any) bool { if x == nil { return true } @@ -148,7 +160,7 @@ type notMatcher struct { m Matcher } -func (n notMatcher) Matches(x interface{}) bool { +func (n notMatcher) Matches(x any) bool { return !n.m.Matches(x) } @@ -160,7 +172,7 @@ type assignableToTypeOfMatcher struct { targetType reflect.Type } -func (m assignableToTypeOfMatcher) Matches(x interface{}) bool { +func (m assignableToTypeOfMatcher) Matches(x any) bool { return reflect.TypeOf(x).AssignableTo(m.targetType) } @@ -172,7 +184,7 @@ type allMatcher struct { matchers []Matcher } -func (am allMatcher) Matches(x interface{}) bool { +func (am allMatcher) Matches(x any) bool { for _, m := range am.matchers { if !m.Matches(x) { return false @@ -193,7 +205,7 @@ type lenMatcher struct { i int } -func (m lenMatcher) Matches(x interface{}) bool { +func (m lenMatcher) Matches(x any) bool { v := reflect.ValueOf(x) switch v.Kind() { case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice, reflect.String: @@ -208,10 +220,10 @@ func (m lenMatcher) String() string { } type inAnyOrderMatcher struct { - x interface{} + x any } -func (m inAnyOrderMatcher) Matches(x interface{}) bool { +func (m inAnyOrderMatcher) Matches(x any) bool { given, ok := m.prepareValue(x) if !ok { return false @@ -257,7 +269,7 @@ func (m inAnyOrderMatcher) Matches(x interface{}) bool { return extraInGiven == 0 && missingFromWanted == 0 } -func (m inAnyOrderMatcher) prepareValue(x interface{}) (reflect.Value, bool) { +func (m inAnyOrderMatcher) prepareValue(x any) (reflect.Value, bool) { xValue := reflect.ValueOf(x) switch xValue.Kind() { case reflect.Slice, reflect.Array: @@ -280,13 +292,23 @@ func All(ms ...Matcher) Matcher { return allMatcher{ms} } // Any returns a matcher that always matches. func Any() Matcher { return anyMatcher{} } +// Cond returns a matcher that matches when the given function returns true +// after passing it the parameter to the mock function. +// This is particularly useful in case you want to match over a field of a custom struct, or dynamic logic. +// +// Example usage: +// +// Cond(func(x any){return x.(int) == 1}).Matches(1) // returns true +// Cond(func(x any){return x.(int) == 2}).Matches(1) // returns false +func Cond(fn func(x any) bool) Matcher { return condMatcher{fn} } + // Eq returns a matcher that matches on equality. // // Example usage: // // Eq(5).Matches(5) // returns true // Eq(5).Matches(4) // returns false -func Eq(x interface{}) Matcher { return eqMatcher{x} } +func Eq(x any) Matcher { return eqMatcher{x} } // Len returns a matcher that matches on length. This matcher returns false if // is compared to a type that is not an array, chan, map, slice, or string. @@ -310,7 +332,7 @@ func Nil() Matcher { return nilMatcher{} } // // Not(Eq(5)).Matches(4) // returns true // Not(Eq(5)).Matches(5) // returns false -func Not(x interface{}) Matcher { +func Not(x any) Matcher { if m, ok := x.(Matcher); ok { return notMatcher{m} } @@ -328,7 +350,7 @@ func Not(x interface{}) Matcher { // // var ctx = reflect.TypeOf((*context.Context)(nil)).Elem() // AssignableToTypeOf(ctx).Matches(context.Background()) // returns true -func AssignableToTypeOf(x interface{}) Matcher { +func AssignableToTypeOf(x any) Matcher { if xt, ok := x.(reflect.Type); ok { return assignableToTypeOfMatcher{xt} } @@ -341,6 +363,6 @@ func AssignableToTypeOf(x interface{}) Matcher { // // InAnyOrder([]int{1, 2, 3}).Matches([]int{1, 3, 2}) // returns true // InAnyOrder([]int{1, 2, 3}).Matches([]int{1, 2}) // returns false -func InAnyOrder(x interface{}) Matcher { +func InAnyOrder(x any) Matcher { return inAnyOrderMatcher{x} } diff --git a/vendor/google.golang.org/grpc/call.go b/vendor/google.golang.org/grpc/call.go index a67a3db0..788c89c1 100644 --- a/vendor/google.golang.org/grpc/call.go +++ b/vendor/google.golang.org/grpc/call.go @@ -27,11 +27,6 @@ import ( // // All errors returned by Invoke are compatible with the status package. func (cc *ClientConn) Invoke(ctx context.Context, method string, args, reply any, opts ...CallOption) error { - if err := cc.idlenessMgr.OnCallBegin(); err != nil { - return err - } - defer cc.idlenessMgr.OnCallEnd() - // allow interceptor to see all applicable call options, which means those // configured as defaults from dial option as well as per-call options opts = combine(cc.dopts.callOptions, opts) diff --git a/vendor/google.golang.org/grpc/clientconn.go b/vendor/google.golang.org/grpc/clientconn.go index d53d91d5..ff7fea10 100644 --- a/vendor/google.golang.org/grpc/clientconn.go +++ b/vendor/google.golang.org/grpc/clientconn.go @@ -1091,8 +1091,8 @@ func (ac *addrConn) updateAddrs(addrs []resolver.Address) { ac.cancel() ac.ctx, ac.cancel = context.WithCancel(ac.cc.ctx) - // We have to defer here because GracefulClose => Close => onClose, which - // requires locking ac.mu. + // We have to defer here because GracefulClose => onClose, which requires + // locking ac.mu. if ac.transport != nil { defer ac.transport.GracefulClose() ac.transport = nil @@ -1680,16 +1680,7 @@ func (ac *addrConn) tearDown(err error) { ac.updateConnectivityState(connectivity.Shutdown, nil) ac.cancel() ac.curAddr = resolver.Address{} - if err == errConnDrain && curTr != nil { - // GracefulClose(...) may be executed multiple times when - // i) receiving multiple GoAway frames from the server; or - // ii) there are concurrent name resolver/Balancer triggered - // address removal and GoAway. - // We have to unlock and re-lock here because GracefulClose => Close => onClose, which requires locking ac.mu. - ac.mu.Unlock() - curTr.GracefulClose() - ac.mu.Lock() - } + channelz.AddTraceEvent(logger, ac.channelzID, 0, &channelz.TraceEventDesc{ Desc: "Subchannel deleted", Severity: channelz.CtInfo, @@ -1703,6 +1694,29 @@ func (ac *addrConn) tearDown(err error) { // being deleted right away. channelz.RemoveEntry(ac.channelzID) ac.mu.Unlock() + + // We have to release the lock before the call to GracefulClose/Close here + // because both of them call onClose(), which requires locking ac.mu. + if curTr != nil { + if err == errConnDrain { + // Close the transport gracefully when the subConn is being shutdown. + // + // GracefulClose() may be executed multiple times if: + // - multiple GoAway frames are received from the server + // - there are concurrent name resolver or balancer triggered + // address removal and GoAway + curTr.GracefulClose() + } else { + // Hard close the transport when the channel is entering idle or is + // being shutdown. In the case where the channel is being shutdown, + // closing of transports is also taken care of by cancelation of cc.ctx. + // But in the case where the channel is entering idle, we need to + // explicitly close the transports here. Instead of distinguishing + // between these two cases, it is simpler to close the transport + // unconditionally here. + curTr.Close(err) + } + } } func (ac *addrConn) getState() connectivity.State { diff --git a/vendor/google.golang.org/grpc/stream.go b/vendor/google.golang.org/grpc/stream.go index 421a41f8..b14b2fbe 100644 --- a/vendor/google.golang.org/grpc/stream.go +++ b/vendor/google.golang.org/grpc/stream.go @@ -158,11 +158,6 @@ type ClientStream interface { // If none of the above happen, a goroutine and a context will be leaked, and grpc // will not call the optionally-configured stats handler with a stats.End message. func (cc *ClientConn) NewStream(ctx context.Context, desc *StreamDesc, method string, opts ...CallOption) (ClientStream, error) { - if err := cc.idlenessMgr.OnCallBegin(); err != nil { - return nil, err - } - defer cc.idlenessMgr.OnCallEnd() - // allow interceptor to see all applicable call options, which means those // configured as defaults from dial option as well as per-call options opts = combine(cc.dopts.callOptions, opts) @@ -179,6 +174,16 @@ func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth } func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (_ ClientStream, err error) { + // Start tracking the RPC for idleness purposes. This is where a stream is + // created for both streaming and unary RPCs, and hence is a good place to + // track active RPC count. + if err := cc.idlenessMgr.OnCallBegin(); err != nil { + return nil, err + } + // Add a calloption, to decrement the active call count, that gets executed + // when the RPC completes. + opts = append([]CallOption{OnFinish(func(error) { cc.idlenessMgr.OnCallEnd() })}, opts...) + if md, added, ok := metadata.FromOutgoingContextRaw(ctx); ok { // validate md if err := imetadata.Validate(md); err != nil { diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go index 914ce665..2a910c3c 100644 --- a/vendor/google.golang.org/grpc/version.go +++ b/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.58.0" +const Version = "1.58.1" diff --git a/vendor/modules.txt b/vendor/modules.txt index 31830a92..61c39f11 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -121,8 +121,8 @@ github.com/stretchr/testify/require github.com/thingspect/api/go/api github.com/thingspect/api/go/common github.com/thingspect/api/go/mqtt -# go.uber.org/mock v0.2.0 -## explicit; go 1.19 +# go.uber.org/mock v0.3.0 +## explicit; go 1.20 go.uber.org/mock/gomock # golang.org/x/crypto v0.13.0 ## explicit; go 1.17 @@ -161,18 +161,18 @@ golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm golang.org/x/text/width -# google.golang.org/genproto v0.0.0-20230911183012-2d3300fd4832 +# google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb ## explicit; go 1.19 google.golang.org/genproto/internal -# google.golang.org/genproto/googleapis/api v0.0.0-20230911183012-2d3300fd4832 +# google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb ## explicit; go 1.19 google.golang.org/genproto/googleapis/api google.golang.org/genproto/googleapis/api/annotations google.golang.org/genproto/googleapis/api/httpbody -# google.golang.org/genproto/googleapis/rpc v0.0.0-20230911183012-2d3300fd4832 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb ## explicit; go 1.19 google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.58.0 +# google.golang.org/grpc v1.58.1 ## explicit; go 1.19 google.golang.org/grpc google.golang.org/grpc/attributes