volatiletech / authboss

The boss of http auth.
MIT License
3.85k stars 207 forks source link

Type can be omitted #270

Closed frederikhors closed 4 years ago

aarondl commented 4 years ago

The reason you write a line like this: var _ http.Handler = handler in Go is to ensure that the handler's type implements the interface http.Handler. Hence the comment above. It's part of the test to ensure the type of the error handler's return implements the interface. In the current code it returns the http.Handler interface which is fine, but it may change one day and so I don't think this change is necessary/good.