Skip to content

Commit d279398

Browse files
committed
fix linter complaints
1 parent 0c76afb commit d279398

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

decode_hooks.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -717,11 +717,8 @@ func StringToComplex128HookFunc() DecodeHookFunc {
717717
// StringToMailAddressHookFunc returns a DecodeHookFunc that converts
718718
// strings to mail.Address.
719719
func StringToMailAddressHookFunc() DecodeHookFunc {
720-
return func(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error) {
721-
if f.Kind() != reflect.String {
722-
return data, nil
723-
}
724-
if t != reflect.TypeOf(mail.Address{}) {
720+
return func(f reflect.Type, t reflect.Type, data any) (any, error) {
721+
if f.Kind() != reflect.String || t != reflect.TypeOf(mail.Address{}) {
725722
return data, nil
726723
}
727724

0 commit comments

Comments
 (0)