- go get -u github.com/swaggo/swag/cmd/swag
- go get -u github.com/swaggo/gin-swagger
- go get -u github.com/swaggo/files
- swag init
After every 'swag init' command run, a new docs folder will be created. Then browse http://localhost:8080/docs/index.html we will see the swagger documentation.
If your main.go file is not in root but uses the models defined in root, you can provide the path of main.go file.
- swag init -d "./" -g "$FOLDER_NAME/main.go"