Go每日一题(4)

结构比对:

受影响因素:字段顺序,字段类型,字段值

package main

import(
    "fmt"
)

func main(){
    
    sn1 := struct{ 
        name string 
        age int }{age: 11, name: "tom" }
    sn2 := struct{
         name string 
        age int }{age: 11, name: "tom" }
    
    fmt.Println(sn1 == sn2)
}

 

posted @ 2019-12-26 19:27  Marksion  阅读(145)  评论(0编辑  收藏  举报