From eb1f2ffcfcb0e0cad14d430e39b619db5b7c52d3 Mon Sep 17 00:00:00 2001 From: stepbystep2 <770954908@qq.com> Date: Thu, 12 May 2022 14:21:43 +0800 Subject: [PATCH] docs: starting in Go 1.17, use `go install`. (#210) --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 097cbee..fb34982 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # gin-swagger -gin middleware to automatically generate RESTFUL API documentation with Swagger 2.0. +gin middleware to automatically generate RESTful API documentation with Swagger 2.0. [![Build Status](https://github.com/swaggo/gin-swagger/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/features/actions) [![Codecov branch](https://img.shields.io/codecov/c/github/swaggo/gin-swagger/master.svg)](https://codecov.io/gh/swaggo/gin-swagger) @@ -19,6 +19,12 @@ gin middleware to automatically generate RESTFUL API documentation with Swagger go get -u github.com/swaggo/swag/cmd/swag ``` +Starting in Go 1.17, installing executables with `go get` is deprecated. `go install` may be used instead: + +```sh +go install github.com/swaggo/swag/cmd/swag +``` + 3. Run the [Swag](https://github.com/swaggo/swag) at your Go project root path(for instance `~/root/go-peoject-name`), [Swag](https://github.com/swaggo/swag) will parse comments and generate required files(`docs` folder and `docs/doc.go`) at `~/root/go-peoject-name/docs`.