diff --git a/options.go b/options.go index 2407fe5..d3f9caf 100644 --- a/options.go +++ b/options.go @@ -32,7 +32,7 @@ type Options struct { // MapStructConfig for binding data to struct. MapStructConfig mapstructure.DecoderConfig // BeforeCollect value handle func, you can return a new value. - BeforeCollect func(name string, val any) interface{} + BeforeCollect func(name string, val any) any } func (opts *Options) makeDecoderConfig() *mapstructure.DecoderConfig { diff --git a/options_test.go b/options_test.go index 454271c..b97c193 100644 --- a/options_test.go +++ b/options_test.go @@ -81,7 +81,7 @@ expire = 3s // tests Unmarshal, BeforeCollect p := properties.NewParser(properties.ParseTime, func(opts *properties.Options) { - opts.BeforeCollect = func(name string, val any) interface{} { + opts.BeforeCollect = func(name string, val any) any { if name == "name" { return strutil.Upper(val.(string)) } diff --git a/util.go b/util.go index 6f835f3..36f8af6 100644 --- a/util.go +++ b/util.go @@ -12,7 +12,7 @@ import ( // ValDecodeHookFunc returns a mapstructure.DecodeHookFunc that parse time string func ValDecodeHookFunc() mapstructure.DecodeHookFunc { - return func(f reflect.Type, t reflect.Type, data any) (interface{}, error) { + return func(f reflect.Type, t reflect.Type, data any) (any, error) { if f.Kind() != reflect.String { return data, nil }