From 6767e1ff640e776a0505fb5e79211ca2cad67848 Mon Sep 17 00:00:00 2001 From: redwrasse Date: Mon, 23 Sep 2024 10:12:40 -0700 Subject: [PATCH] command: Use errors.Is for error equality check in ep_command.go Signed-off-by: redwrasse --- etcdctl/ctlv3/command/ep_command.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etcdctl/ctlv3/command/ep_command.go b/etcdctl/ctlv3/command/ep_command.go index 2fb017c1fd0..c0df89d26a8 100644 --- a/etcdctl/ctlv3/command/ep_command.go +++ b/etcdctl/ctlv3/command/ep_command.go @@ -15,6 +15,7 @@ package command import ( + "errors" "fmt" "os" "sync" @@ -137,7 +138,7 @@ func epHealthCommandFunc(cmd *cobra.Command, args []string) { _, err = cli.Get(ctx, "health") eh := epHealth{Ep: ep, Health: false, Took: time.Since(st).String()} // permission denied is OK since proposal goes through consensus to get it - if err == nil || err == rpctypes.ErrPermissionDenied { + if err == nil || errors.Is(err, rpctypes.ErrPermissionDenied) { eh.Health = true } else { eh.Error = err.Error()