Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you have a value type, you don't need to implement Is. It's just that errors.New (and fmt.Errorf) doesn't return a value type, so such errors only match under errors.Is if they have the same identity, hence why you typically see them defined with package-level sentinel variables.


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

Search: