Skip to content

Commit

Permalink
refactor: remove a few warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
subnova committed Aug 29, 2023
1 parent 2369cab commit 3f7127d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion manager/handlers/has2be/certificate_signed_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions manager/handlers/has2be/get_15118_ev_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions manager/handlers/has2be/sign_certificate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -45,7 +45,7 @@ func TestPassesPEMEncodedCsrOnAsIs(t *testing.T) {
RecordedCsr: &csrRecorder,
}
handler := handlersHasToBe.SignCertificateHandler{
Handler201: spy201Handler,
Handler201: &spy201Handler,
}
req := &typesHasToBe.SignCertificateRequestJson{
Csr: pemEncodedCsr,
Expand All @@ -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),
Expand Down

0 comments on commit 3f7127d

Please sign in to comment.