func TestMapEqu(t *testing.T) {
    m1 := map[string]any{"a": "1", "b": 2, "c": 3}
    m2 := map[string]any{"a": 1, "c": "3", "b": 2}
    m3 := map[string]any{"a": "1", "b": 2, "c": 3}
    fmt.Println(reflect.DeepEqual(m1, m2))
    fmt.Println(reflect.DeepEqual(m1, m3))

    fmt.Println(reflect.DeepEqual(m1["b"], m2["b"]))
    fmt.Println(reflect.DeepEqual(m1["a"], m2["a"]))
}

发表回复

您的电子邮箱地址不会被公开。

Captcha Code