Skip to content

net/url: empty query value is dropped on Encode() #20820

Closed
@carl-mastrangelo

Description

@carl-mastrangelo

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

1.9

https://play.golang.org/p/FWtvu_9XEM

The Values.Encode function adds an unnecessary = to the end of kv pairs, even if the original value was empty. When using flag style url query values, this is kind of annoying because it is supposed to be either present or absent.

It would be nice to interpret a url.Values with nil value slice as a flag, and skip the = for encoding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions