代码改变世界

go 的路由中间件实现原理

2020-05-19 13:00  muamaker  阅读(1053)  评论(0编辑  收藏  举报
利用go原生的 http 模块,写一个简单的服务,然后实现以下路由中间件 一、简单的中间件实现 package main import ( "fmt" "net/http" "time" ) func hello(wr http.ResponseWriter, r *http.Request) {