Server 源码
package main
import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/micro/go-micro/v2/registry"
"github.com/micro/go-micro/v2/registry/etcd"
"github.com/micro/go-micro/v2/web"
)
// 全局中间件
func GlobalMiddle(c *gin.Context) {
fmt.Println("中间件")
}
func main() {
reg := etcd.NewRegistry(
registry.Addrs("127.0.0.1:2379"),
)
router := gin.New()
router.Use(GlobalMiddle)
router.Handle("GET", "/"</