From 5aac42dbe71cae4d94294860166dcf95d5e92aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6ran=20Karl?= <3951388+JoeKar@users.noreply.github.com> Date: Sun, 12 May 2024 11:49:49 +0200 Subject: [PATCH] bindings: Convert `os.IsNotExist()` into `errors.Is()` --- internal/action/bindings.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/action/bindings.go b/internal/action/bindings.go index 67c4634c..1eb2a6f0 100644 --- a/internal/action/bindings.go +++ b/internal/action/bindings.go @@ -4,6 +4,7 @@ import ( "encoding/json" "errors" "fmt" + "io/fs" "io/ioutil" "os" "path/filepath" @@ -24,7 +25,7 @@ var Binder = map[string]func(e Event, action string){ } func createBindingsIfNotExist(fname string) { - if _, e := os.Stat(fname); os.IsNotExist(e) { + if _, e := os.Stat(fname); errors.Is(e, fs.ErrNotExist) { ioutil.WriteFile(fname, []byte("{}"), 0644) } }