-
Notifications
You must be signed in to change notification settings - Fork 34
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
refactor!: have knuu as an object #356
Conversation
Since this is a relatively nuanced why of keeping backwards compatibility I would recommend you add some comments to the top of the Otherwise I think it puts a lot of pressure and burden on the team to keep the context of this refactor in their minds while working on fixes and features. |
Is it possible to add a deprecation annotation to the old functions so that we see in the code when we use those functions? |
good idea, done. |
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.
lgtm. I think all open discussions can be turned into follow up issues 👍🏻
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.
you 🪨 🙌
This PR proposes a structural change to the knuu pkg to have it as an object.
This helps to have more idiomatic code and enable us to add unit tests easier. Moreover, since every test can have their own knuu object and handle everything in isolation.
Note 1: in order to keep it backward compatible with the current tests, some wrapper functions with a global var is added, and they are in a number of files with
_old.go
postfix so we can delete the files when the users are ready to use this one.Note 2: There was an attempt not to change everything, i.e. the refactor tries to focus on introducing an object structure for knuu. So, we need a number of refactor rounds on the knuu pkg and in general on the repo.
Closes #328