Using swag (from swaggo) to generating Swagger/OpenAPI documentation in your Go project

Install swag CLI tool (Only first time / Update Version) Add swag tag/annotation to your Go code There are 2 locations Note: you can use AI to help generate swag tag/annotation to your Go code. My prompt “I want you to add Swagger annotations to handler functions and select file auth_handler.go” in my Git Copilot Console Update Doc Again Add Swagger UI to your project Install the middleware for your web framework (for example, gin): And access your swagger doc via [YOUR_BASE_PATH], the image below is Go fiber example Reference