summaryrefslogtreecommitdiff
path: root/internal/configuration/decode_hooks.go
diff options
context:
space:
mode:
authorJames Elliott <james-d-elliott@users.noreply.github.com>2022-01-15 13:01:40 +1100
committerGitHub <noreply@github.com>2022-01-15 13:01:40 +1100
commitfe4bfc1c75a581272fda0e5a699b545481040290 (patch)
treefafb1fe755765a69b6786181dff77e34fbb1e2aa /internal/configuration/decode_hooks.go
parent73b7900feef026082feae87765f63e404824bc19 (diff)
fix(configuration): mail address decode hook func (#2790)
This fixes an issue with the mail address decode hook func which previously would attempt to decode any struct type to a mail address.
Diffstat (limited to 'internal/configuration/decode_hooks.go')
-rw-r--r--internal/configuration/decode_hooks.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/configuration/decode_hooks.go b/internal/configuration/decode_hooks.go
index b2012d9ff..513f7fd37 100644
--- a/internal/configuration/decode_hooks.go
+++ b/internal/configuration/decode_hooks.go
@@ -10,8 +10,8 @@ import (
// StringToMailAddressFunc decodes a string into a mail.Address.
func StringToMailAddressFunc() mapstructure.DecodeHookFunc {
- return func(f reflect.Kind, t reflect.Kind, data interface{}) (value interface{}, err error) {
- if f != reflect.String || t != reflect.TypeOf(mail.Address{}).Kind() {
+ return func(f reflect.Type, t reflect.Type, data interface{}) (value interface{}, err error) {
+ if f.Kind() != reflect.String || t != reflect.TypeOf(mail.Address{}) {
return data, nil
}