'how to do versioning in Golang REST API via swaggo?

To generate swagger documentation I use swaggo (https://github.com/swaggo/swag ). I need to split the documentation into v1 and v2 versions. How can I implement this? Can I do something similar like it's done here https://github.com/dotnet/aspnet-api-versioning/issues/516 , but only for Go?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source