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 httptest.NewRequest #12

Closed
oliverpool opened this issue Mar 13, 2021 · 1 comment
Closed

Use httptest.NewRequest #12

oliverpool opened this issue Mar 13, 2021 · 1 comment

Comments

@oliverpool
Copy link

Thanks for the great tutorial!

You currently use http.NewRequest in your tests:

request, err := http.NewRequest(...)
require.NoError(t, err)

This could be replaced with httptest.NewRequest which panics on error

request := httptest.NewRequest(...)
@techschool
Copy link
Owner

Good idea. Thank you!

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

No branches or pull requests

2 participants