草庐IT

authRoute

全部标签

go - 使用 GO 和 gorilla mux 的动态路由查询

我正在使用gorillamux设置动态路由,这是routes.go代码typeRoutestruct{NamestringMethodstringPatternstringQueries[]stringHandlerFunchttp.HandlerFunc}typeRoutes[]Routevarvers=os.Getenv("API_VERSION")varbaseURL="/api/"+vers+"/"varauthRoutes=Routes{Route{"GetAllUsers","GET",baseURL+"users",[]string{"maxperpage","{maxp