Relative Content

Tag Archive for unit-testinggohttprouter

(why) Is it necessary to path parameters via request context?

I’m working on a simple toy API in Golang using httprouter and trying to write tests for my endpoints. One of my endpoints is a “show movie” endpoint with a path like /v1/movies/:id . For this endpoint, I initially wrote the test creating the request like `