golang-jwt / jwt

Go implementation of JSON Web Tokens (JWT).
https://golang-jwt.github.io/jwt/
MIT License
6.99k stars 336 forks source link

Refactor: remove unnecessary init() functions #331

Closed alexandear closed 1 year ago

alexandear commented 1 year ago

This PR removes init() functions. Calling the init() is considered a bad practice and it's easy to rewrite code in this library.

See https://github.com/leighmcculloch/gochecknoinits and https://peter.bourgon.org/blog/2017/06/09/theory-of-modern-go.html for further reading.

Also, the PR rewrites tests to use httptest.Server with local mux to simplify code.