summaryrefslogtreecommitdiff
path: root/internal/configuration/decode_hooks.go
diff options
context:
space:
mode:
authorJames Elliott <james-d-elliott@users.noreply.github.com>2022-10-05 16:05:23 +1100
committerGitHub <noreply@github.com>2022-10-05 16:05:23 +1100
commitdc79c8ea59622d19db22dae6753936da2be6412f (patch)
tree75465ddc18215115c382b97ac7a0382361f9f69c /internal/configuration/decode_hooks.go
parent9ae703fe5152b09e0484e31d54dec573e9f0ea7c (diff)
refactor: any (#4133)
* refactor: any * refactor: fix test
Diffstat (limited to 'internal/configuration/decode_hooks.go')
-rw-r--r--internal/configuration/decode_hooks.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/configuration/decode_hooks.go b/internal/configuration/decode_hooks.go
index 9dd236690..d3c5d5c44 100644
--- a/internal/configuration/decode_hooks.go
+++ b/internal/configuration/decode_hooks.go
@@ -19,7 +19,7 @@ import (
// StringToMailAddressHookFunc decodes a string into a mail.Address or *mail.Address.
func StringToMailAddressHookFunc() mapstructure.DecodeHookFuncType {
- return func(f reflect.Type, t reflect.Type, data interface{}) (value interface{}, err error) {
+ return func(f reflect.Type, t reflect.Type, data any) (value any, err error) {
var ptr bool
if f.Kind() != reflect.String {
@@ -65,7 +65,7 @@ func StringToMailAddressHookFunc() mapstructure.DecodeHookFuncType {
// StringToURLHookFunc converts string types into a url.URL or *url.URL.
func StringToURLHookFunc() mapstructure.DecodeHookFuncType {
- return func(f reflect.Type, t reflect.Type, data interface{}) (value interface{}, err error) {
+ return func(f reflect.Type, t reflect.Type, data any) (value any, err error) {
var ptr bool
if f.Kind() != reflect.String {
@@ -111,7 +111,7 @@ func StringToURLHookFunc() mapstructure.DecodeHookFuncType {
// ToTimeDurationHookFunc converts string and integer types to a time.Duration.
func ToTimeDurationHookFunc() mapstructure.DecodeHookFuncType {
- return func(f reflect.Type, t reflect.Type, data interface{}) (value interface{}, err error) {
+ return func(f reflect.Type, t reflect.Type, data any) (value any, err error) {
var ptr bool
switch f.Kind() {
@@ -172,7 +172,7 @@ func ToTimeDurationHookFunc() mapstructure.DecodeHookFuncType {
// StringToRegexpHookFunc decodes a string into a *regexp.Regexp or regexp.Regexp.
func StringToRegexpHookFunc() mapstructure.DecodeHookFuncType {
- return func(f reflect.Type, t reflect.Type, data interface{}) (value interface{}, err error) {
+ return func(f reflect.Type, t reflect.Type, data any) (value any, err error) {
var ptr bool
if f.Kind() != reflect.String {
@@ -218,7 +218,7 @@ func StringToRegexpHookFunc() mapstructure.DecodeHookFuncType {
// StringToAddressHookFunc decodes a string into an Address or *Address.
func StringToAddressHookFunc() mapstructure.DecodeHookFuncType {
- return func(f reflect.Type, t reflect.Type, data interface{}) (value interface{}, err error) {
+ return func(f reflect.Type, t reflect.Type, data any) (value any, err error) {
var ptr bool
if f.Kind() != reflect.String {
@@ -258,7 +258,7 @@ func StringToAddressHookFunc() mapstructure.DecodeHookFuncType {
// StringToX509CertificateHookFunc decodes strings to x509.Certificate's.
func StringToX509CertificateHookFunc() mapstructure.DecodeHookFuncType {
- return func(f reflect.Type, t reflect.Type, data interface{}) (value interface{}, err error) {
+ return func(f reflect.Type, t reflect.Type, data any) (value interface{}, err error) {
if f.Kind() != reflect.String {
return data, nil
}