build(deps): bump github.com/gookit/config/v2 from 2.2.4 to 2.2.5

Bumps [github.com/gookit/config/v2](https://github.com/gookit/config) from 2.2.4 to 2.2.5.
- [Release notes](https://github.com/gookit/config/releases)
- [Commits](https://github.com/gookit/config/compare/v2.2.4...v2.2.5)

---
updated-dependencies:
- dependency-name: github.com/gookit/config/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2024-01-16 12:57:39 +01:00
committed by Ralf Haferkamp
parent 2253096609
commit 81e000b987
33 changed files with 1028 additions and 626 deletions
+6 -5
View File
@@ -10,8 +10,9 @@ func HasChild(v reflect.Value) bool {
switch v.Kind() {
case reflect.Array, reflect.Slice, reflect.Map, reflect.Struct:
return true
default:
return false
}
return false
}
// IsArrayOrSlice check. eg: array, slice
@@ -122,9 +123,9 @@ func IsEmpty(v reflect.Value) bool {
return v.Float() == 0
case reflect.Interface, reflect.Ptr, reflect.Func:
return v.IsNil()
default:
return reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface())
}
return reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface())
}
// IsEmptyValue reflect value check, alias of the IsEmptyReal()
@@ -158,7 +159,7 @@ func IsEmptyReal(v reflect.Value) bool {
return v.IsNil()
case reflect.Invalid:
return true
default:
return reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface())
}
return reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface())
}
+6 -6
View File
@@ -126,12 +126,12 @@ func ConvToKind(val any, kind reflect.Kind) (rv reflect.Value, err error) {
rv = reflect.ValueOf(dstV)
}
case reflect.Uint:
var dstV uint64
var dstV uint
if dstV, err = mathutil.ToUint(val); err == nil {
rv = reflect.ValueOf(uint(dstV))
rv = reflect.ValueOf(dstV)
}
case reflect.Uint8:
var dstV uint64
var dstV uint
if dstV, err = mathutil.ToUint(val); err == nil {
if dstV > math.MaxUint8 {
return rv, fmt.Errorf("value overflow uint8. val: %v", val)
@@ -139,7 +139,7 @@ func ConvToKind(val any, kind reflect.Kind) (rv reflect.Value, err error) {
rv = reflect.ValueOf(uint8(dstV))
}
case reflect.Uint16:
var dstV uint64
var dstV uint
if dstV, err = mathutil.ToUint(val); err == nil {
if dstV > math.MaxUint16 {
return rv, fmt.Errorf("value overflow uint16. val: %v", val)
@@ -147,7 +147,7 @@ func ConvToKind(val any, kind reflect.Kind) (rv reflect.Value, err error) {
rv = reflect.ValueOf(uint16(dstV))
}
case reflect.Uint32:
var dstV uint64
var dstV uint
if dstV, err = mathutil.ToUint(val); err == nil {
if dstV > math.MaxUint32 {
return rv, fmt.Errorf("value overflow uint32. val: %v", val)
@@ -156,7 +156,7 @@ func ConvToKind(val any, kind reflect.Kind) (rv reflect.Value, err error) {
}
case reflect.Uint64:
var dstV uint64
if dstV, err = mathutil.ToUint(val); err == nil {
if dstV, err = mathutil.ToUint64(val); err == nil {
rv = reflect.ValueOf(dstV)
}
case reflect.Float32:
+1 -2
View File
@@ -2,7 +2,6 @@
package reflects
import (
"fmt"
"reflect"
)
@@ -12,6 +11,6 @@ var (
anyType = reflect.TypeOf((*any)(nil)).Elem()
errorType = reflect.TypeOf((*error)(nil)).Elem()
fmtStringerType = reflect.TypeOf((*fmt.Stringer)(nil)).Elem()
// fmtStringerType = reflect.TypeOf((*fmt.Stringer)(nil)).Elem()
reflectValueType = reflect.TypeOf((*reflect.Value)(nil)).Elem()
)