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

Small codebase refactors / cleanups #75

Merged
merged 6 commits into from
Jan 19, 2023
Merged

Small codebase refactors / cleanups #75

merged 6 commits into from
Jan 19, 2023

Conversation

benjojo
Copy link
Collaborator

@benjojo benjojo commented Jan 19, 2023

This is the output of my initial pass through the code, fixing things that either are small "this could go wrong" or just simplifying some areas out completely.

I also improved the error messages from the packages, sometimes just setting their capitalisation to what you would mostly expect from go programs, but also adding clarification on some of them.

The default value of runtime.GOMAXPROCS is the number of CPUs. So
there is no need for this line to exist.
They serve the same function, but it's more understandable what
is going on. go-static-check raises this as a warning
IP.Equal handles some edge cases inside how IP addresses are represented
rather than just flat out comparing some byte arrays blindly.
if err != nil {
log.Fatal(err)
}
defer ff.Close()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good catch!

Copy link
Collaborator

@ties ties left a comment

Choose a reason for hiding this comment

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

Imo this is a good set of cleanups and small refactorings.

@benjojo benjojo merged commit 634ed94 into master Jan 19, 2023
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.

2 participants