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
Fix issues found by linter #37
Fix issues found by linter #37
Conversation
3ea3182
to
8770111
Compare
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.
Good job!
A few nits, but looks good overall.
I'll leave it to @chdxD1 to test this and to consider the two fixed allocation bugs.
if addr.Scope != unix.RT_SCOPE_UNIVERSE { | ||
continue | ||
} | ||
info.AnycastGateways = append(info.AnycastGateways, &addr) |
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.
@chdxD1 this was a bug that is getting fixed in this PR.
By simply referencing it this way, the same address is added multiple times: https://husni.dev/beware-of-implicit-memory-aliasing-in-go-foor-loop/
if addr.Scope != unix.RT_SCOPE_UNIVERSE { | ||
continue | ||
} | ||
info.AnycastGateways = append(info.AnycastGateways, &addr) |
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.
@chdxD1 same here.
Co-authored-by: Jakob Schrettenbrunner <dev@schrej.net>
Co-authored-by: Jakob Schrettenbrunner <dev@schrej.net>
Co-authored-by: Jakob Schrettenbrunner <dev@schrej.net>
Co-authored-by: Jakob Schrettenbrunner <dev@schrej.net>
This PR is continuation of #36
It fixes all the issues found by the golangci-lint configuration introduced in #36.
NOTE: This PR should be fully tested in production-grade test environment before being merged, as I am not able to do so.