diff --git a/pkg/kvm/kvm_test.go b/pkg/kvm/kvm_test.go index bcfd8ffc..d2d41563 100644 --- a/pkg/kvm/kvm_test.go +++ b/pkg/kvm/kvm_test.go @@ -5,6 +5,7 @@ package kvm import ( + "context" "fmt" "log" "net" @@ -48,6 +49,9 @@ type stubJSONRRPC struct { err error } +// build time check that struct implements interface +var _ spdk.JSONRPC = (*stubJSONRRPC)(nil) + func (s stubJSONRRPC) GetID() uint64 { return 0 } @@ -56,11 +60,11 @@ func (s stubJSONRRPC) StartUnixListener() net.Listener { return nil } -func (s stubJSONRRPC) GetVersion() string { +func (s stubJSONRRPC) GetVersion(_ context.Context) string { return "" } -func (s stubJSONRRPC) Call(method string, _, result interface{}) error { +func (s stubJSONRRPC) Call(_ context.Context, method string, _, result interface{}) error { if method == "vhost_create_blk_controller" { if s.err == nil { resultCreateVirtioBLk, ok := result.(*spdk.VhostCreateBlkControllerResult) diff --git a/pkg/middleend/qos_test.go b/pkg/middleend/qos_test.go index b1fa7013..7bb87757 100644 --- a/pkg/middleend/qos_test.go +++ b/pkg/middleend/qos_test.go @@ -5,6 +5,7 @@ package middleend import ( + "context" "fmt" "net" "testing" @@ -33,6 +34,9 @@ type stubJSONRRPC struct { params []any } +// build time check that struct implements interface +var _ spdk.JSONRPC = (*stubJSONRRPC)(nil) + func (s *stubJSONRRPC) GetID() uint64 { return 0 } @@ -41,11 +45,11 @@ func (s *stubJSONRRPC) StartUnixListener() net.Listener { return nil } -func (s *stubJSONRRPC) GetVersion() string { +func (s *stubJSONRRPC) GetVersion(_ context.Context) string { return "" } -func (s *stubJSONRRPC) Call(_ string, param interface{}, _ interface{}) error { +func (s *stubJSONRRPC) Call(_ context.Context, _ string, param interface{}, _ interface{}) error { s.params = append(s.params, param) return nil }