Hmm, I think this method demonstrates that it gets messy very quickly to not use a REST framework. This is more relevant for the alertmanager than Prometheus itself because alertmanager has a richer HTTP REST interface, accepting different HTTP methods on the same endpoint and encoding path components (like IDs) in the URL. Both shouldn't be decoded/switched on manually in this day and age, IMO. It should be handled by a library. Especially, I'd like to see separate methods for each HTTP verb.

Could you use whatever REST framework is stable and popular these days? There's http://www.gorillatoolkit.org/, but there's also others like https://github.com/emicklei/go-restful. Martini (https://github.com/go-martini/martini) actually also looks nice, has many stars on Github, and is super lightweight.