go-sample-api Web api in golang with Gin farmwork Update swagger document swag init -g main.go Important command go mod int <package_name> go get <package_url> go mod vendor go mod tidy go mod vendor swag init -g main.go Debug it locally Please install delve Click on debugger to run it. run it http://localhost:8080/swagger/index.html