Skip to content

net/http: make use of Method* constants internally #18577

Closed
@mdlayher

Description

@mdlayher

Now that net/http has Method* constants, it'd be nice to get rid of all of the "GET", "POST, etc. string literals within the package itself. To me, this is the cleaner approach, and reduces the risk of a typo causing unexpected behavior later on.

This was prompted by my discussion with @dsnet here: https://go-review.googlesource.com/c/34981/#message-d7e7dafd6c2425712709da0b275efaf3140be26a.

I'd be happy to put in a CL for this for Go 1.9, if it's deemed worthwhile. I much prefer constants to string literals, but wanted to check in before going ahead with a CL.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions