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 <ismaelariasmn@gmail.com>
This commit is contained in:
Ismael Arias 2023-07-17 17:49:05 +02:00
parent ca9874ab7d
commit 47997857ff
1 changed files with 2 additions and 1 deletions

View File

@ -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())
}