1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-09 15:12:26 +08:00

refactor: interface{} -> any

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

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))