From 3f7127d3ff448249ab78e48208fe15b7ec2e8da1 Mon Sep 17 00:00:00 2001 From: Dale Peakall Date: Tue, 29 Aug 2023 16:20:48 +0100 Subject: [PATCH] refactor: remove a few warnings --- manager/handlers/has2be/certificate_signed_result.go | 2 +- manager/handlers/has2be/get_15118_ev_certificate.go | 4 ++-- manager/handlers/has2be/sign_certificate_test.go | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/manager/handlers/has2be/certificate_signed_result.go b/manager/handlers/has2be/certificate_signed_result.go index cef7a27..cbf8d4f 100644 --- a/manager/handlers/has2be/certificate_signed_result.go +++ b/manager/handlers/has2be/certificate_signed_result.go @@ -13,7 +13,7 @@ import ( type CertificateSignedResultHandler struct{} -func (c CertificateSignedResultHandler) HandleCallResult(ctx context.Context, chargeStationId string, request ocpp.Request, response ocpp.Response, state any) error { +func (c CertificateSignedResultHandler) HandleCallResult(ctx context.Context, _ string, _ ocpp.Request, response ocpp.Response, _ any) error { span := trace.SpanFromContext(ctx) resp := response.(*has2be.CertificateSignedResponseJson) diff --git a/manager/handlers/has2be/get_15118_ev_certificate.go b/manager/handlers/has2be/get_15118_ev_certificate.go index 0325887..4a5349f 100644 --- a/manager/handlers/has2be/get_15118_ev_certificate.go +++ b/manager/handlers/has2be/get_15118_ev_certificate.go @@ -14,7 +14,7 @@ type Get15118EvCertificateHandler struct { Handler201 handlers.CallHandler } -func (g Get15118EvCertificateHandler) HandleCall(ctx context.Context, _ string, request ocpp.Request) (ocpp.Response, error) { +func (g Get15118EvCertificateHandler) HandleCall(ctx context.Context, chargeStationId string, request ocpp.Request) (ocpp.Response, error) { req := request.(*typesHasToBe.Get15118EVCertificateRequestJson) req201 := types201.Get15118EVCertificateRequestJson{ @@ -24,7 +24,7 @@ func (g Get15118EvCertificateHandler) HandleCall(ctx context.Context, _ string, Action: types201.CertificateActionEnumTypeInstall, } - res, err := g.Handler201.HandleCall(ctx, "", &req201) + res, err := g.Handler201.HandleCall(ctx, chargeStationId, &req201) if err != nil { return nil, err } diff --git a/manager/handlers/has2be/sign_certificate_test.go b/manager/handlers/has2be/sign_certificate_test.go index f56efb9..6b93d8b 100644 --- a/manager/handlers/has2be/sign_certificate_test.go +++ b/manager/handlers/has2be/sign_certificate_test.go @@ -18,7 +18,7 @@ type spy201SignCertificateHandler struct { RecordedCsr *string } -func (d spy201SignCertificateHandler) HandleCall(ctx context.Context, chargeStationId string, request ocpp.Request) (ocpp.Response, error) { +func (d *spy201SignCertificateHandler) HandleCall(_ context.Context, _ string, request ocpp.Request) (ocpp.Response, error) { d.recordReceivedCsr(request.(*types201.SignCertificateRequestJson).Csr) return &types201.SignCertificateResponseJson{ Status: types201.GenericStatusEnumTypeAccepted, @@ -45,7 +45,7 @@ func TestPassesPEMEncodedCsrOnAsIs(t *testing.T) { RecordedCsr: &csrRecorder, } handler := handlersHasToBe.SignCertificateHandler{ - Handler201: spy201Handler, + Handler201: &spy201Handler, } req := &typesHasToBe.SignCertificateRequestJson{ Csr: pemEncodedCsr, @@ -67,7 +67,7 @@ func TestDecodesBase64EncodedDERAndReencodesAsPEM(t *testing.T) { RecordedCsr: &csrRecorder, } handler := handlersHasToBe.SignCertificateHandler{ - Handler201: spy201Handler, + Handler201: &spy201Handler, } req := &typesHasToBe.SignCertificateRequestJson{ Csr: base64.StdEncoding.EncodeToString(csrBytes),