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/blockdev/blockdev_linux.go b/metropolis/pkg/blockdev/blockdev_linux.go
index 6d87c87..b5ef106 100644
--- a/metropolis/pkg/blockdev/blockdev_linux.go
+++ b/metropolis/pkg/blockdev/blockdev_linux.go
@@ -72,7 +72,7 @@
// Attempts to leverage discard guarantees to provide extremely quick
// metadata-only zeroing.
err = unix.Fallocate(int(fd), unix.FALLOC_FL_PUNCH_HOLE|unix.FALLOC_FL_KEEP_SIZE, startByte, endByte-startByte)
- if err == unix.EOPNOTSUPP {
+ if errors.Is(err, unix.EOPNOTSUPP) {
// Tries Write Same and friends and then just falls back to writing
// zeroes.
_, _, err = unix.Syscall(unix.SYS_IOCTL, fd, unix.BLKZEROOUT, uintptr(unsafe.Pointer(&args[0])))