It looks like there is a typo here that would fail if this line is executed. Or am I not seeing something?
There is another one but it is cute and does no harm
The typo is actually harmeless: the next.ServeHTTP(ctx.Resp, ctx.Req) will use the next argument of the inner function. And go build would have caught that mistake. Mystery solved.