summaryrefslogtreecommitdiff
path: root/Magefile.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-14 11:08:15 +0300
committerPaul Buetow <paul@buetow.org>2026-04-14 11:08:15 +0300
commitf143b6daca50eba520ceaec51c36222ab6ae667d (patch)
tree18cc8299b0e87fd8e633334abf74f57fd77f2a44 /Magefile.go
parent9d32b8138baf821d72eb1f5a7a218f9b1949c853 (diff)
fix(r3): use errors.Is for sentinel error comparisons
Replace direct == checks with errors.Is so wrapped errors are handled correctly (authkeys Verify, daemon server/EOF, Magefile uninstall). Refs: ask r3, 100 Go Mistakes #51 Made-with: Cursor
Diffstat (limited to 'Magefile.go')
-rw-r--r--Magefile.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/Magefile.go b/Magefile.go
index 742ffbf..a72c6be 100644
--- a/Magefile.go
+++ b/Magefile.go
@@ -5,6 +5,7 @@ package main
// Magefile for goprecords. Targets follow the same style as other Go projects (e.g. hexai).
import (
+ "errors"
"fmt"
"os"
"path/filepath"
@@ -82,7 +83,7 @@ func Uninstall() error {
gopath = filepath.Join(home, "go")
}
dest := filepath.Join(gopath, "bin", binaryName)
- if err := os.Remove(dest); err != nil && !os.IsNotExist(err) {
+ if err := os.Remove(dest); err != nil && !errors.Is(err, os.ErrNotExist) {
return err
}
return nil