Skip to content

Commit

Permalink
improve README setup/init (#104)
Browse files Browse the repository at this point in the history
* update swaggo/swag install instructions

update swaggo/swag install to reflect current information on that page (also `go get` alone does not install binary, so current instructions are incomplete)

* remove $ from sh commands to allow direct copy/paste to temrinal
  • Loading branch information
mefuller committed Aug 23, 2023
1 parent 7a7a18f commit 1bc40aa
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions README.md
Expand Up @@ -14,18 +14,20 @@ V2 require go 1.16 or higher due to the use of `embed` package.
### Start using it
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 github.com/swaggo/swag/cmd/swag
go install github.com/swaggo/swag/cmd/swag@latest
```
To build from source you need [Go](https://golang.org/dl/) (1.17 or newer).

Or download a pre-compiled binary from the [release page](https://github.com/swaggo/swag/releases).

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`).
```sh
$ swag init
swag init
```
4.Download [http-swagger](https://github.com/swaggo/http-swagger) by using:
4. Download [http-swagger](https://github.com/swaggo/http-swagger) by using:
```sh
$ go get -u github.com/swaggo/http-swagger
go get -u github.com/swaggo/http-swagger
```
And import following in your code:

Expand Down

0 comments on commit 1bc40aa

Please sign in to comment.