Skip to content

net/url: Why make struct Userinfo's username and password immutable? #31853

@shiduanguang

Description

@shiduanguang

// The Userinfo type is an immutable encapsulation of username and

I need to hide username and password of an url when log it.
So, I use u, err := url.Parse(rawurl), and want to change u.User.
But url.Userinfo username and password is not exported.

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