Reflection, Go structs, and JSON marshalling FTW!
Small?
Yes, the framework consists of only three functions:
HandleGet, HandlePost, RunServer.
Evil?
Well, this package can be considered bad design because
HandleGet and HandlePost use dynamic typing to hide 36 combinations
of handler function/method types to make the interface _easy_ to use.
36 static functions would have been more lines of code but
dramatic _simpler_ in their individual implementations.
So simple in fact, that there wouldn't be a point in
abstracting them away in an extra framework.
See this great talk about easy vs. simple:
Rob Pike may also dislike this approach:
So yes, this package can be called evild because it is an
anti-pattern to all that is good and right about Go.
Why use it then? By maximizing dynamic code
it is easy to use and reduces code.
Yes, that introduces some internal complexity,
but this complexity is still very low in absolute terms
and thus easy to control and debug.
The complexity of the dynamic code also does not spill over
into the package users' code, because the arguments and
results of the handler functions must be static typed
and can't be interface{}.