Skip to content

net/url: inaccurate documentation for method URL.String #10227

@bmatsuo

Description

@bmatsuo

go version: 1.4.2

problem: The godoc for URL.String in "net/url" does not accurately describe the method's behavior when the Opaque field is set.

scheme:opaque
scheme://userinfo@host/path?query#fragment

If u.Opaque is non-empty, String uses the first form; otherwise it uses the second form.

The following playground link demonstrates a *url.URL which does not fall into these categories.

http://play.golang.org/p/SPGP5eSieA

The documentation states that the snippet should print "https://example.com/foo". But they observed string is "https://example.com/foo?bar=baz#qux"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions