diff --git a/README.md b/README.md index 9d09a33..86dd900 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ gin middleware to automatically generate RESTful API documentation with Swagger 1. Add comments to your API source code, [See Declarative Comments Format](https://github.com/swaggo/swag#declarative-comments-format). 2. Download [Swag](https://github.com/swaggo/swag) for Go by using: ```sh -$ go get -u github.com/swaggo/swag +$ go get github.com/swaggo/swag/cmd/swag ``` 3. Run the [Swag](https://github.com/swaggo/swag) in your Go project root folder which contains `main.go` file, [Swag](https://github.com/swaggo/swag) will parse comments and generate required files(`docs` folder and `docs/doc.go`). @@ -57,7 +57,8 @@ import ( // @BasePath /v2 func main() { r := gin.New() - + + // use ginSwagger middleware to r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) r.Run() diff --git a/swagger.go b/swagger.go index 9ba09d5..c7f49f8 100644 --- a/swagger.go +++ b/swagger.go @@ -9,7 +9,7 @@ import ( "github.com/swaggo/swag" ) -// WrapHandler wraps `http.Handler` into `echo.HandlerFunc`. +// WrapHandler wraps `http.Handler` into `gin.HandlerFunc`. func WrapHandler(h *webdav.Handler) gin.HandlerFunc { //create a template with name t := template.New("swagger_index.html")