You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like I forgot to add a test case. As per https://tools.ietf.org/html/rfc4007 (and considering https://tools.ietf.org/html/rfc6874 for the interoperability of the output of JoinHostPort), JoinHostPort should not enclose any non-IP literal in square brackets, and remove any scope zone identifier if necessary for avoiding ambiguity.
For example,
package main
import (
"fmt"
"net"
)
func main() {
// /etc/hosts should have an entry mapping "locahost" to "::1".
for _, host := range []string{"localhost", "::1", "::1%lo0", "localhost%lo0"} {
fmt.Println(net.JoinHostPort(host, ""))
}
// Output:
// localhost:
// [::1]:
// [::1%lo0]:
// localhost: not [localhost%lo0]:
}
The text was updated successfully, but these errors were encountered:
Looks like I forgot to add a test case. As per https://tools.ietf.org/html/rfc4007 (and considering https://tools.ietf.org/html/rfc6874 for the interoperability of the output of JoinHostPort), JoinHostPort should not enclose any non-IP literal in square brackets, and remove any scope zone identifier if necessary for avoiding ambiguity.
For example,
The text was updated successfully, but these errors were encountered: