Go HTTP middleware from scratch