refactor: interface{} -> any

This commit is contained in:
dudaodong committed 2022-03-16 18:41:40 +08:00
1 parent af480efa8c
commit c939b26cb8
34 files changed
+194 -195

No files matched your search

+2 -2
View File
@@ -6,7 +6,7 @@ import (
)
// sliceValue return the reflect value of a slice
func sliceValue(slice interface{}) reflect.Value {
func sliceValue(slice any) reflect.Value {
v := reflect.ValueOf(slice)
if v.Kind() != reflect.Slice {
panic(fmt.Sprintf("Invalid slice type, value of type %T", slice))
@@ -15,7 +15,7 @@ func sliceValue(slice interface{}) reflect.Value {
}
// functionValue return the reflect value of a function
func functionValue(function interface{}) reflect.Value {
func functionValue(function any) reflect.Value {
v := reflect.ValueOf(function)
if v.Kind() != reflect.Func {
panic(fmt.Sprintf("Invalid function type, value of type %T", function))