diff --git a/libcontainer/cgroups/fscommon/utils.go b/libcontainer/cgroups/fscommon/utils.go index f4eee4051..196abf95d 100644 --- a/libcontainer/cgroups/fscommon/utils.go +++ b/libcontainer/cgroups/fscommon/utils.go @@ -3,6 +3,7 @@ package fscommon import ( + "errors" "fmt" "math" "path" @@ -45,10 +46,7 @@ func ParseUint(s string, base, bitSize int) (uint64, error) { // 2. Handle negative values lesser than MinInt64 if intErr == nil && intValue < 0 { return 0, nil - // Note errors.Is is not working for strconv errors in Go 1.13, - // see https://github.com/golang/go/issues/36325. - // TODO: remove nolint and switch to errors.Is once we stop supporting Go 1.13. - } else if intErr != nil && intErr.(*strconv.NumError).Err == strconv.ErrRange && intValue < 0 { //nolint:errorlint + } else if errors.Is(intErr, strconv.ErrRange) && intValue < 0 { return 0, nil }