Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use constants from net/http instead of setting HTTP methods manually #28

Merged
merged 1 commit into from
May 24, 2021

Conversation

sysvinit
Copy link
Contributor

As detailed in the commit message, this cleans up the code a little to use the constants for HTTP methods from net/http instead of writing the strings in manually. This makes the code a little more robust against typos, as the library constants can be checked by the compiler.

This amends the HTTP method checking to use symbolic consants from net/http
instead of magic strings. Using library constants means the compiler will catch
typos for us, which it wouldn't be able to do otherwise.
@ThomasLeister ThomasLeister merged commit cdedc44 into ThomasLeister:develop May 24, 2021
@ThomasLeister
Copy link
Owner

Thanks for cleaning up the code! :-)

@sysvinit sysvinit deleted the http-methods branch May 24, 2021 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants