What does a typical handler look like in this scenario (url path params). I usually end up using Gorilla mux for this, but standard library for everything else.
I create a simple func for each handler to parse params. Most urls params are properly structured as /resources/{resourceID}/subresources/{subresourceID}.
So I can essentially create a map[string]string by splitting slashes and going 0 = key, 1 = value, 2 = key, 3 = value, etc.
If a handler uses a different structure like /resources/{resourceID}/{subresourceD}, I will have the func specifically handle that case.
Some ways may work better but this works for me and it's not magical, and I tend to touch that code once and never again so it's then out of the way, all in a file.
So I can essentially create a map[string]string by splitting slashes and going 0 = key, 1 = value, 2 = key, 3 = value, etc.
If a handler uses a different structure like /resources/{resourceID}/{subresourceD}, I will have the func specifically handle that case.
Some ways may work better but this works for me and it's not magical, and I tend to touch that code once and never again so it's then out of the way, all in a file.