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

Migrate from ioutil to io #976

Closed
wants to merge 4 commits into from
Closed

Conversation

rodneyosodo
Copy link

This pull request refactors the codebase to replace the deprecated ioutil package with the modern io package functions, while also applying additional code style and formatting improvements. The implementation updates function calls, simplifies goroutine closures, removes obsolete debugging code, and standardizes variable declarations to improve clarity and maintainability.

Related to #962

Copy link
Contributor

@VojtechVitek VojtechVitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for your contribution.

However, I just merged a similar PR #962, which came first.

Feel free to rebase and submit the other contributions separately. Thanks!

Signed-off-by: Rodney Osodo <[email protected]>
Signed-off-by: Rodney Osodo <[email protected]>
Signed-off-by: Rodney Osodo <[email protected]>
@rodneyosodo
Copy link
Author

@VojtechVitek I have rebased

@@ -444,34 +443,6 @@ func TestTreeFindPattern(t *testing.T) {
}
}

func debugPrintTree(parent int, i int, n *node, label byte) bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep this code, its handy if we ever need it again

Copy link
Member

@pkieltyka pkieltyka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like a lot of changes just to switch to "io" ..

@@ -148,7 +148,7 @@ func (n *node) InsertRoute(method methodTyp, pattern string, handler http.Handle

// We're going to be searching for a wild node next,
// in this case, we need to get the tail
var label = search[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change style back as how it was please

@@ -242,7 +242,6 @@ func (n *node) addChild(child *node, prefix string) *node {

// Add child depending on next up segment
switch segTyp {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep the spacing between lines as it is.. I prefer it.. more readable

nMagenta = []byte{'\033', '[', '3', '5', 'm'}
nCyan = []byte{'\033', '[', '3', '6', 'm'}
nWhite = []byte{'\033', '[', '3', '7', 'm'}
nRed = []byte{'\033', '[', '3', '1', 'm'}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im confused

@VojtechVitek
Copy link
Contributor

VojtechVitek commented Feb 16, 2025

Given we merged the "io" changes in #962, I'll close this one.

Let's keep the code style and debugging code intact.

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

Successfully merging this pull request may close these issues.

3 participants