🗺️

Swagger

编写文档

// file: router/router.go package router import ( "github.com/sohaha/zlsgo/znet" swagger "github.com/sohaha/zlsgo-swagger" _ "app/docs ) // @title app // @version 1.0.0 // @description zlsgo app // @basePath / // @contact.name Seekwe // @contact.email [email protected] func Register() { r := znet.New() // 注册到 /docs/ swagger.RegisterDocs(r) znet.Run() }

生成文档

go get -u github.com/swaggo/swag/cmd/swag swag init -g router/router.go -o ./docs/swagger/