From 2d1645d2e56d1cf629ea8bb2b5216579b0a6efcd Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 19 Jul 2021 15:12:32 -0700 Subject: [PATCH] libct/cg/fscommon: drop go 1.13 compatibility Signed-off-by: Kir Kolyshkin --- libcontainer/cgroups/fscommon/utils.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 }