mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-10 18:56:55 +02:00
refactor: minor styling fixes; deadcode cleanup and correct log level
This commit is contained in:
@@ -105,12 +105,14 @@ func ValidateWithFieldTags(s any) error {
|
||||
detail = "require " + strconv.Quote(detail)
|
||||
}
|
||||
errs.Add(gperr.PrependSubject(ErrValidationError, e.Namespace()).
|
||||
Withf(detail))
|
||||
Withf("%s", detail))
|
||||
}
|
||||
}
|
||||
return errs.Error()
|
||||
}
|
||||
|
||||
// dive recursively dives into the nested pointers of the dst.
|
||||
// dst value pointer must be valid (satisfies reflect.Value.IsValid()).
|
||||
func dive(dst reflect.Value) (v reflect.Value, t reflect.Type) {
|
||||
dstT := dst.Type()
|
||||
for {
|
||||
@@ -445,7 +447,7 @@ func Convert(src reflect.Value, dst reflect.Value, checkValidateTag bool) error
|
||||
}
|
||||
obj, ok := src.Interface().(SerializedObject)
|
||||
if !ok {
|
||||
return fmt.Errorf("convert: %w for %s to %s", ErrUnsupportedConversion, dstT, srcT)
|
||||
return fmt.Errorf("convert: %w from %s to %s", ErrUnsupportedConversion, srcT, dstT)
|
||||
}
|
||||
return mapUnmarshalValidate(obj, dst.Addr(), checkValidateTag)
|
||||
case srcKind == reflect.Slice: // slice to slice
|
||||
|
||||
Reference in New Issue
Block a user