Skip to content

Commit 1be8dd7

Browse files
committed
up: replace inteface{} to any keywords
1 parent e9c75b8 commit 1be8dd7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type Options struct {
3232
// MapStructConfig for binding data to struct.
3333
MapStructConfig mapstructure.DecoderConfig
3434
// BeforeCollect value handle func, you can return a new value.
35-
BeforeCollect func(name string, val any) interface{}
35+
BeforeCollect func(name string, val any) any
3636
}
3737

3838
func (opts *Options) makeDecoderConfig() *mapstructure.DecoderConfig {

options_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ expire = 3s
8181

8282
// tests Unmarshal, BeforeCollect
8383
p := properties.NewParser(properties.ParseTime, func(opts *properties.Options) {
84-
opts.BeforeCollect = func(name string, val any) interface{} {
84+
opts.BeforeCollect = func(name string, val any) any {
8585
if name == "name" {
8686
return strutil.Upper(val.(string))
8787
}

util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
// ValDecodeHookFunc returns a mapstructure.DecodeHookFunc that parse time string
1414
func ValDecodeHookFunc() mapstructure.DecodeHookFunc {
15-
return func(f reflect.Type, t reflect.Type, data any) (interface{}, error) {
15+
return func(f reflect.Type, t reflect.Type, data any) (any, error) {
1616
if f.Kind() != reflect.String {
1717
return data, nil
1818
}

0 commit comments

Comments
 (0)