Context: I am doing unit tests and was trying to check if I got expected errors.
I didn't have the expected result so I tried something simple which is comparing to exact errors and I was surprise that the comparison returned "false"
e1 := errors.New("error")
e2 := errors.New("error")
fmt.Println(e1 == e2) // false
Run Example: https://play.golang.org/p/cvjjiJT_5T
Can someone explain me why this returns false and how to properly check equality between errors ?