On 2020-09-29 18:38, Axel Wagner wrote: > I hope not. If you want to handle a specific error, what you should do is file > an issue to expose that error as a type (and thus make it part of the API of > the > package), not to match strings - precisely *because* they aren't part of the > stable API, if they are not exposed, so shouldn't be relied on. >
OK. I expected not but thought they were unlikely to change atleast. > For your specific case, have you tried `errors.Is(err, > syscall.Errno(syscall.ENETUNREACH))`? That works, Thank You I feel like a few of these should probably be exposed in the net package? Perhaps they haven't because different systems return different ones in different circumstances, but I hope Posix means that isn't the case. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/091726ef-29c6-31f1-f128-b2a15ebea26a%40gmail.com.