Add Swagger Docs to a Go API
Swagger allows developers to easily create api documentation which is defined using comments in the code and then generated as a yaml config file. In this post we’ll be using it alongside Go (golang).
Using tools like Swagger has many advantages, like allowing you to generate documentation automatically (saving you time) and that it keeps your code and documentation as close as possible (in distance terms). The idea being that if the docs are hard to update and far away, you just won’t.