Skip to content

net/url: URL should parse the port number and store it separately #10262

@foresmac

Description

@foresmac

The port number from a URL should not be left tacked on the end of the host when parsing a URL into a url.URL struct. Instead, the port number should be pulled out and added to a url.URL.Port field. Leaving the port in a parsed hostname invariably leaves developers calling strings.Split(url.URL.Host, ":")[0] repeatedly to get the hostname.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions