libct/cg/fscommon: drop go 1.13 compatibility

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2021-07-19 15:12:32 -07:00
parent 6215b2f33f
commit 2d1645d2e5
+2 -4
View File
@@ -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
}