Closed alexandear closed 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.
init()
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.
httptest.Server
This PR removes
init()
functions. Calling theinit()
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.