From 47997857ff73f47bd3f00a1d56ac9423d09658a5 Mon Sep 17 00:00:00 2001 From: Ismael Arias Date: Mon, 17 Jul 2023 17:49:05 +0200 Subject: [PATCH] Replace error check for non-existent file Previously `os.IsNotExist(err)`, now `errors.Is(err, fs.ErrNotExist)` [NO NEW TESTS NEEDED] Signed-off-by: Ismael Arias --- pkg/trust/policy.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/trust/policy.go b/pkg/trust/policy.go index 21222c3570..8ede8f6a72 100644 --- a/pkg/trust/policy.go +++ b/pkg/trust/policy.go @@ -7,6 +7,7 @@ import ( "encoding/json" "errors" "fmt" + "io/fs" "os" "os/exec" "path/filepath" @@ -65,7 +66,7 @@ func DefaultPolicyPath(sys *types.SystemContext) string { if err == nil { return userPolicyFilePath } - if !os.IsNotExist(err) { + if !errors.Is(err, fs.ErrNotExist) { logrus.Warnf("Error trying to read local config file: %s", err.Error()) }