Closed arniethepie closed 7 months ago
nit picky, but my only criticism is the naming of query.go and stats.go - both technically provide stats, and both are technically queries :D something like api.go and db.go might be more fitting just to further improve readability? :)
nit picky, but my only criticism is the naming of query.go and stats.go - both technically provide stats, and both are technically queries :D something like api.go and db.go might be more fitting just to further improve readability? :)
Agreeeeeeed, merged
@AppIe314 approved, thanks again!
Description
I had a go at splitting up the 700 line Porygon.go file into different packages. Not a Go expert so these probably could have been separated a little bit better. Also low hanging fruit but changed deprecated ioutil just to io.
Packages created:
go func
in main.go. Definitely needs improvement because I wasn't sure how to expose the config to this package so you have to pass the config into every query function 💀query.ApiRequest
out of main.go. Also the name maybe a little confusing, wanted to name itgolbat
or maybeexternal
(similar usage in the Golbat repo I think)As for testing, running Porygon for the past few hours has been fine with these changes, no errors. Functionality is exactly the same. As for adding actual tests, probably a future thing :P.
Still a lot of work to be done in terms of refactoring but hopefully this is just a starting.