• akkajdh999@programming.dev
    link
    fedilink
    arrow-up
    14
    ·
    10 hours ago

    In Go “==” operator works for everything by default, I like it more:

    type A struct {
    	Name string
    	Quality int
    }
    func main() {
    	var x A
    	var y A
    	fmt.Printf("%v", x == y)
    }
    
    

    (if all you want is to compare all corresponding fields which you usually want)