treewide: replace error comparisons and assertions with errors.Is
Change-Id: Id2424eb155f2c6842c72c5fafd124d428ef901f2
Reviewed-on: https://review.monogon.dev/c/monogon/+/2994
Tested-by: Jenkins CI
Reviewed-by: Serge Bazanski <serge@monogon.tech>
diff --git a/metropolis/pkg/fsquota/fsquota.go b/metropolis/pkg/fsquota/fsquota.go
index 1cdcd54..af87d9f 100644
--- a/metropolis/pkg/fsquota/fsquota.go
+++ b/metropolis/pkg/fsquota/fsquota.go
@@ -22,6 +22,7 @@
package fsquota
import (
+ "errors"
"fmt"
"math"
"os"
@@ -66,7 +67,7 @@
// infrequent calls this should not be an immediate issue.
for {
quota, err := quotactl.GetNextQuota(dir, quotactl.QuotaTypeProject, lastID)
- if err == unix.ENOENT || err == unix.ESRCH {
+ if errors.Is(err, unix.ENOENT) || errors.Is(err, unix.ESRCH) {
// We have enumerated all quotas, nothing exists here
break
} else if err != nil {