Skip to content

Commit

Permalink
style(go): convert switch to if.
Browse files Browse the repository at this point in the history
Signed-off-by: Thibault Normand <[email protected]>
  • Loading branch information
Zenithar committed Jun 28, 2022
1 parent c247d78 commit d5af22b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/keys/ed25519.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit d5af22b

Please sign in to comment.