bgp / stayrtr

RPKI-To-Router server implementation in Go
BSD 3-Clause "New" or "Revised" License
91 stars 13 forks source link

Controversial change... #37

Closed mellowdrifter closed 2 years ago

mellowdrifter commented 2 years ago

There may be pushback for this change, but hear me out. Two reasons I moved main to run: 1 - This is a good overview as to the why: https://pace.dev/blog/2020/02/12/why-you-shouldnt-use-func-main-in-golang-by-mat-ryer.html 2 - main() is currently 218 lines long. As as noted before it's difficult to test. Doing it this way makes it easier.

Long term, the vast majority of the initial set up should be in their own functions and run() should merely call these functions to set up that state, then downloading VRPs, then sitting and waiting for clients.

job commented 2 years ago

@ties @randomthingsandstuff this is up to you

randomthingsandstuff commented 2 years ago

Yeah this isn't controversial from my POV. I mean, its low-hanging stuff to make testing a little bit better. Approve from my side.

ties commented 2 years ago

Not controversial to me either. The other refactoring (args) proposed in that blog also looks good to me.