Tiago Alves Dulce
Tiago Alves Dulce
As mentioned by Luke here: https://github.com/decred/dcrtime/pull/84#discussion_r1021757335. We already have the middleware defined here: https://github.com/decred/dcrtime/blob/bbebe6df45a8c650c4e605d778494480b056f121/dcrtimed/dcrtimed.go#L1297 And are using it here: https://github.com/decred/dcrtime/blob/bbebe6df45a8c650c4e605d778494480b056f121/dcrtimed/dcrtimed.go#L1306 As we add every route with the `addRoute` method. It...
Since Go 1.16 the ioutil package [has been deprecated](https://pkg.go.dev/io/ioutil). The same functionality is now provided by package io or package os.
As Luke mentioned here: https://github.com/decred/dcrtime/pull/84#discussion_r1021767766. We are handling erros individually for each route which generates a lot of boilerplate. Ideally we would abstract this behavior to make the code simpler...