polyfloyd / go-errorlint

A source code linter that can be used to find code that will cause problems with Go's error wrapping scheme
MIT License
249 stars 19 forks source link

Allow comparisons with http.ErrServerClosed #14

Closed tmaxmax closed 3 years ago

tmaxmax commented 3 years ago

It is a well-known and documented behavior that when calling the Shutdown method of an http.Server, the call to Serve, ListenAndServe and their TLS variations return the ErrServerClosed error value, unwrapped. This PR adds these methods, along with their free functions shorthands to the list of allowed errors for comparison.

polyfloyd commented 3 years ago

Thanks!