From c8d47d5b4ae92c018b2abb089ad499ae30d98664 Mon Sep 17 00:00:00 2001 From: WANG CHAO <1229983126@qq.com> Date: Tue, 6 Sep 2022 15:36:31 +0800 Subject: [PATCH] chore: Update multiple API example (#224) --- example/multiple/main.go | 4 ++-- go.mod | 2 +- go.sum | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/example/multiple/main.go b/example/multiple/main.go index f362c15..c464456 100644 --- a/example/multiple/main.go +++ b/example/multiple/main.go @@ -15,11 +15,11 @@ func main() { // Register api/v1 endpoints v1.Register(router) - router.GET("/swagger/v1/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, ginSwagger.InstanceName("v1"))) + router.GET("/swagger/v1/*any", ginSwagger.WrapHandler(swaggerFiles.NewHandler(), ginSwagger.InstanceName("v1"))) // Register api/v2 endpoints v2.Register(router) - router.GET("/swagger/v2/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, ginSwagger.InstanceName("v2"))) + router.GET("/swagger/v2/*any", ginSwagger.WrapHandler(swaggerFiles.NewHandler(), ginSwagger.InstanceName("v2"))) // Listen and Server in _ = router.Run() diff --git a/go.mod b/go.mod index 70d5c0d..d74ccd9 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/gin-contrib/gzip v0.0.6 github.com/gin-gonic/gin v1.8.1 github.com/stretchr/testify v1.8.0 - github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe + github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a github.com/swaggo/swag v1.8.1 golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 ) diff --git a/go.sum b/go.sum index 6740f72..00fc225 100644 --- a/go.sum +++ b/go.sum @@ -127,6 +127,8 @@ github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2 h1:+iNTcqQJy0OZ5jk6a5 github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w= github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe h1:K8pHPVoTgxFJt1lXuIzzOX7zZhZFldJQK/CgKx9BFIc= github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w= +github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a h1:kAe4YSu0O0UFn1DowNo2MY5p6xzqtJ/wQ7LZynSvGaY= +github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w= github.com/swaggo/swag v1.8.1 h1:JuARzFX1Z1njbCGz+ZytBR15TFJwF2Q7fu8puJHhQYI= github.com/swaggo/swag v1.8.1/go.mod h1:ugemnJsPZm/kRwFUnzBlbHRd0JY9zE1M4F+uy2pAaPQ= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=