结构体还与结构体顺序有关
m1 := struct {
name string
age int
}{"dan", 11}
m2 := struct {
age int
name string
}{11, "dan"}
if reflect.DeepEqual(m1, m2) {
fmt.Println(111)
}
结构体还与结构体顺序有关
m1 := struct {
name string
age int
}{"dan", 11}
m2 := struct {
age int
name string
}{11, "dan"}
if reflect.DeepEqual(m1, m2) {
fmt.Println(111)
}
本文标题:不输出111
本文链接:https://www.haomeiwen.com/subject/avfjyhtx.html
网友评论