roundaboutluke / porygon

Porygon is a reimagining of Discoropole written in go
9 stars 6 forks source link

Break down Porygon.go with separate packages for readability #15

Closed arniethepie closed 7 months ago

arniethepie commented 7 months ago

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:

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.

roundaboutluke commented 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? :)

arniethepie commented 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? :)

Agreeeeeeed, merged

roundaboutluke commented 7 months ago

@AppIe314 approved, thanks again!