Skip to content
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

Context aware refactoring #136

Open
ccoVeille opened this issue Nov 30, 2024 · 0 comments
Open

Context aware refactoring #136

ccoVeille opened this issue Nov 30, 2024 · 0 comments

Comments

@ccoVeille
Copy link
Contributor

I'm well aware of how the context could/should be used in a well designed application, but properly implementing it into the current codebase would be close to a full rewrite 🙈
So I opted to not try and change everything at once, but instead focus on the bits I wanted to add and make small improvements in the surrounding parts to make that possible.
I actually started with a function that returns a context in main, more of less exactly how you are proposing 😉, but the current layout of the app is not realy designed to work that way as it uses lots of global variables to store types (like the main Application type) that are being called from locations all over the code.
Properly restructering that in a more idiomatic layout would be a reasonably big change that should be a PR on itself in my opinion (and should be endorced by @jorgerojas26 as the owner/maintainer of this code).
Edit: Not proposing such a rewrite by the way! I like the tool and love to fix bugs that bug me or contribute features I'm missing, but I do have a (quite) busy day job as well 😊

Maybe the discussions we had here, could be quoted in a dedicated issue about a possible refactoring that would make the app more idiomatic, especially the context.

The issue might be closed then,but at least there will be a track of the discussion in an issue

That is a really good idea. I sadly did not know about Context api when i started building lazysql (remember this is my first touch on Go). So, that refactor would be a good idea.

Originally posted by @jorgerojas26 in #129 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant