-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Go packaging #131
Go packaging #131
Conversation
@@ -0,0 +1,14 @@ | |||
package clock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like a really small package this one :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok thx. the pkg refactor should had been done soon or later (better in the middle as to sooner or later).
looks good. only the clock
package could we put perhaps somewhere if possible (but not utils
a like things). But I'm fine also with this
I'm glad you approve @MalloZup, I spent a non-trivial amount of time on this, to find a naming that works, which is hard as usual! By the way, Besides, I think there is nothing wrong with a very small package, OTOH a miscellaneous package will eventually grow and become confusing at some point! |
@stefanotorresi yeah I know that utils is weird man :grin. I was tryint to optimize the optimized. I think is ok to have small things 😁 . Unless they are not milions of it , but we are ok |
This PR introduces a more proper separation of the various parts of the project using Go packages.
Every collector now has a dedicated sub-package inside the
collector
package, and common generic code is stored in dedicatedinternal
packages. All of this was done according to various Go best practices.The only code in the
main
package is the one that creates the binary.This is propedeutic to further development where some structs are very likely to eventually occur into name clashes (e.g.
Resource
,Device
,Node
are all entities that may be present in different collectors), so they needed to be namespaced in different packages.