From d5af22b783122f7c7ad81ca9b1b8725cdadad35e Mon Sep 17 00:00:00 2001 From: Thibault Normand Date: Tue, 28 Jun 2022 08:33:02 +0200 Subject: [PATCH] style(go): convert switch to if. Signed-off-by: Thibault Normand --- pkg/keys/ed25519.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/keys/ed25519.go b/pkg/keys/ed25519.go index 896a99150..82178f5d0 100644 --- a/pkg/keys/ed25519.go +++ b/pkg/keys/ed25519.go @@ -55,10 +55,8 @@ func (e *ed25519Verifier) UnmarshalPublicKey(key *data.PublicKey) error { // Unmarshal key value if err := dec.Decode(e); err != nil { - switch { - case errors.Is(err, io.EOF), errors.Is(err, io.ErrUnexpectedEOF): + if errors.Is(err, io.EOF) || errors.Is(err, io.ErrUnexpectedEOF) { return fmt.Errorf("tuf: the public key is truncated or too large: %w", err) - default: } return err }