From f802075aa8e1f3b471e085ab70e1d3cf71ffb440 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Mon, 27 May 2024 23:00:45 +0200 Subject: [PATCH] Use errors.Is in Password.Match. --- group/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/group/client.go b/group/client.go index e3d2003..d2f7af9 100644 --- a/group/client.go +++ b/group/client.go @@ -64,7 +64,7 @@ func (p Password) Match(pw string) (bool, error) { return false, errors.New("missing key") } err := bcrypt.CompareHashAndPassword([]byte(*p.Key), []byte(pw)) - if err == bcrypt.ErrMismatchedHashAndPassword { + if errors.Is(err, bcrypt.ErrMismatchedHashAndPassword) { return false, nil } return err == nil, err