From 9eed61a9c50fb9c95c22cd30caf3e4b9be88e327 Mon Sep 17 00:00:00 2001 From: beltram Date: Tue, 23 Jan 2024 11:42:09 +0100 Subject: [PATCH] use switch statement --- acme/api/order.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/acme/api/order.go b/acme/api/order.go index 6f4a51e3..b7a1114d 100644 --- a/acme/api/order.go +++ b/acme/api/order.go @@ -278,7 +278,8 @@ func newAuthorization(ctx context.Context, az *acme.Authorization) error { } var target string - if az.Identifier.Type == acme.WireUser { + switch az.Identifier.Type { + case acme.WireUser: wireOptions, err := prov.GetOptions().GetWireOptions() if err != nil { return acme.WrapErrorISE(err, "failed getting Wire options") @@ -295,7 +296,7 @@ func newAuthorization(ctx context.Context, az *acme.Authorization) error { if err != nil { return acme.WrapError(acme.ErrorMalformedType, err, "invalid Go template registered for 'target'") } - } else if az.Identifier.Type == acme.WireDevice { + case acme.WireDevice: wireID, err := wire.ParseID([]byte(az.Identifier.Value)) if err != nil { return acme.WrapError(acme.ErrorMalformedType, err, "failed parsing WireUser")