-
Notifications
You must be signed in to change notification settings - Fork 60
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
replace fmt.Sprintf("%s:%d") with net.JoinHostPort #380
Labels
good first issue
Good for newcomers
Comments
Thanks for pointing this out @kevinburkesegment.
If you'd like to open a PR to fix this, that would be great. |
kevinburkesegment
added a commit
to kevinburkesegment/dskit
that referenced
this issue
Sep 26, 2023
This will ensure ipv6 compatibility for provided hosts, and this method should also be faster than the general purpose fmt.Sprintf, which must first parse the input string. Fixes grafana#380.
2 tasks
kevinburkesegment
added a commit
to kevinburkesegment/dskit
that referenced
this issue
Oct 5, 2023
This will ensure ipv6 compatibility for provided hosts, and this method should also be faster than the general purpose fmt.Sprintf, which must first parse the input string. Fixes grafana#380.
kevinburkesegment
added a commit
to kevinburkesegment/dskit
that referenced
this issue
Oct 5, 2023
This will ensure ipv6 compatibility for provided hosts, and this method should also be faster than the general purpose fmt.Sprintf, which must first parse the input string. Fixes grafana#380.
kevinburkesegment
added a commit
to kevinburkesegment/dskit
that referenced
this issue
Oct 9, 2023
This will ensure ipv6 compatibility for provided hosts, and this method should also be faster than the general purpose fmt.Sprintf, which must first parse the input string. Fixes grafana#380.
kevinburkesegment
added a commit
to kevinburkesegment/dskit
that referenced
this issue
Oct 9, 2023
This will ensure ipv6 compatibility for provided hosts, and this method should also be faster than the general purpose fmt.Sprintf, which must first parse the input string. Fixes grafana#380.
kevinburkesegment
added a commit
to kevinburkesegment/dskit
that referenced
this issue
Oct 9, 2023
This will ensure ipv6 compatibility for provided hosts, and this method should also be faster than the general purpose fmt.Sprintf, which must first parse the input string. Fixes grafana#380.
charleskorn
pushed a commit
that referenced
this issue
Oct 10, 2023
This will ensure ipv6 compatibility for provided hosts, and this method should also be faster than the general purpose fmt.Sprintf, which must first parse the input string. Fixes #380.
ying-jeanne
pushed a commit
that referenced
this issue
Nov 2, 2023
This will ensure ipv6 compatibility for provided hosts, and this method should also be faster than the general purpose fmt.Sprintf, which must first parse the input string. Fixes #380.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Several places in the codebase use fmt.Sprintf to join a host and a port, for example:
Because fmt.Sprintf is a general purpose parser, it will be slower than invoking the fit-for-purpose net.JoinHostPort. In addition, net.JoinHostPort correctly handles ipv6 addresses, which can include colons.
I'd be happy to replace all of these just wanted to point this out.
The text was updated successfully, but these errors were encountered: