-
I have the following code: main.go
userHandler.go:
Now I try to write a test for this handler like this:
Can anyone tell me what I am doing wrong here, so that printing out the routes in |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
ok, thanks to this StackOverflow answer it seems I figured it out: after initializing the context inside the test, you have to define the path, the pathparam and the actual value, too, so the test code for me looks now like:
Would be nice to know if this is really the idiomatic way. |
Beta Was this translation helpful? Give feedback.
ok, thanks to this StackOverflow answer it seems I figured it out:
after initializing the context inside the test, you have to define the path, the pathparam and the actual value, too, so the test code for me looks now like:
Would be nice to know if this is really the idiomatic way.