Skip to content

Use net.JoinHostPort to combine host and port - #1105

Merged
manugarg merged 1 commit into
cloudprober:mainfrom
kaoet:patch-1
Jul 22, 2025
Merged

manugarg merged 1 commit into
cloudprober:mainfrom
kaoet:patch-1

Conversation

@kaoet

@kaoet kaoet commented Jul 22, 2025

Copy link
Copy Markdown
Contributor

When the host is an IPv6 address like ::1, simple fmt.Sprintf() doesn't surrround the host with brackets, while net.JoinHostPort produces correct result like [::1]:80.

When the host is an IPv6 address like `::1`, simple `fmt.Sprintf()` doesn't surrround the host with brackets, while `net.JoinHostPort` produces correct result like `[::1]:80`.

@manugarg manugarg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks!

@manugarg
manugarg merged commit 6d104fa into cloudprober:main Jul 22, 2025
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