From 7f8c43ef1013f5a240c4f37864d5e4e9b33a7841 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 4 Feb 2025 18:17:38 +0100 Subject: [PATCH] cli-plugins/manager: IsNotFound: don't depend on causer interface Signed-off-by: Sebastiaan van Stijn --- cli-plugins/manager/manager.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli-plugins/manager/manager.go b/cli-plugins/manager/manager.go index 223f3ae0a7fd..307fa8229479 100644 --- a/cli-plugins/manager/manager.go +++ b/cli-plugins/manager/manager.go @@ -2,6 +2,7 @@ package manager import ( "context" + "errors" "os" "os/exec" "path/filepath" @@ -42,8 +43,9 @@ type notFound interface{ NotFound() } // IsNotFound is true if the given error is due to a plugin not being found. func IsNotFound(err error) bool { - if e, ok := err.(*pluginError); ok { - err = e.Cause() + var e *pluginError + if errors.As(err, &e) { + err = e.Unwrap() } _, ok := err.(notFound) return ok