// Package wrapper ... // // Description : wrapper ... // // Author : go_developer@163.com<白茶清欢> // // Date : 2023-06-11 21:12 package wrapper import ( "fmt" "reflect" "testing" ) func TestArray(t *testing.T) { val := []interface{}{1, 2, 3} fmt.Println(Array(val).IsValid()) fmt.Println(Array(val).ItemIsInterface()) valInt := []int{1, 2, 3, 1, 4, 5, 6, 7, 7, 6, 9} fmt.Println(Array(valInt).Unique()) a := map[string]interface{}{"name": "zhang"} b := a c := map[string]interface{}{"name": "de"} fmt.Println(reflect.DeepEqual(b, c)) fmt.Println(reflect.DeepEqual(a, b)) fmt.Println(Array(valInt).In("1")) fmt.Println(Array(valInt).In(1)) fmt.Println(Array(valInt).In(2)) fmt.Println(Array(valInt).In(7)) fmt.Println(Array(valInt).In(20)) }