Hacker News new | past | comments | ask | show | jobs | submit login

I guess I am just bad at golang.

Loop variable pointer and nil struct is not nil interface are the two that continue to hound us.




Also:

type MyError {}

var _ error = (&MyError)(nil)

errors.As(err, &MyError{})

---

Panicking because it needs to be &&MyError{} instead is a similar gotcha.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: