diff --git a/pkg/syserr/host_darwin.go b/pkg/syserr/host_darwin.go index 3e8783414..67fa71f95 100644 --- a/pkg/syserr/host_darwin.go +++ b/pkg/syserr/host_darwin.go @@ -28,7 +28,7 @@ const maxErrno = 107 var darwinHostTranslations [maxErrno]*Error func getHostTranslation(err unix.Errno) *Error { - if int(err) >= len(darwinHostTranslations) { + if uint64(err) >= uint64(len(darwinHostTranslations)) { return nil } return darwinHostTranslations[err] diff --git a/pkg/syserr/host_linux.go b/pkg/syserr/host_linux.go index 8acd8609f..dc9a34746 100644 --- a/pkg/syserr/host_linux.go +++ b/pkg/syserr/host_linux.go @@ -29,7 +29,7 @@ const maxErrno = 134 var linuxHostTranslations [maxErrno]*Error func getHostTranslation(err unix.Errno) *Error { - if int(err) >= len(linuxHostTranslations) { + if uint64(err) >= uint64(len(linuxHostTranslations)) { return nil } return linuxHostTranslations[err]