167
I love Rust (lemmy.blahaj.zone)
you are viewing a single comment's thread
view the rest of the comments
[-] akkajdh999@programming.dev 10 points 5 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)

this post was submitted on 15 Nov 2024
167 points (92.8% liked)

Programmer Humor

32472 readers
641 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS