wrapper/array_test.go

28 lines
595 B
Go
Raw Normal View History

2023-06-11 21:17:27 +08:00
// Package wrapper ...
//
// Description : wrapper ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2023-06-11 21:12
package wrapper
import (
"fmt"
2023-06-12 19:09:28 +08:00
"reflect"
2023-06-11 21:17:27 +08:00
"testing"
)
func TestArray(t *testing.T) {
val := []interface{}{1, 2, 3}
2023-06-11 21:17:27 +08:00
fmt.Println(Array(val).IsValid())
fmt.Println(Array(val).ItemIsInterface())
2023-06-12 19:01:31 +08:00
valInt := []int{1, 2, 3, 1, 4, 5, 6, 7, 7, 6, 9}
fmt.Println(Array(valInt).Unique())
2023-06-12 19:09:28 +08:00
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))
2023-06-11 21:17:27 +08:00
}