skip to content
Alvin Lucillo

Go Swaggo

/ 1 min read

💻 Tech

If you have APIs in Go, one way to easily create API documentation is to use a tool like swaggo. It’s easy as running swag init -g ./internal/router/router.go where router.go contains the handler definitions. However, one drawback is you’re writing annotations/decorators above the handlers, which make the code harder to read with the comments not related to its functionality.