Gin does not contain package github.com/gin-gonic/gin/json

When generating API documents using yaag in gin, the following error is thrown during reference synchronization:

go mod tidy 
go: finding module for package gopkg.in/gin-gonic/gin.v1
go: finding module for package github.com/betacraft/yaag/gin/v1
go: finding module for package github.com/betacraft/yaag/yaag
go: found github.com/betacraft/yaag/gin/v1 in github.com/betacraft/yaag v1.0.0
go: found github.com/betacraft/yaag/yaag in github.com/betacraft/yaag v1.0.0
go: found gopkg.in/gin-gonic/gin.v1 in gopkg.in/gin-gonic/gin.v1 v1.3.0
go: finding module for package github.com/gin-gonic/gin/json
dbm/apps/dbm/api imports
        gopkg.in/gin-gonic/gin.v1 imports
        github.com/gin-gonic/gin/json: module github.com/gin-gonic/gin@latest found (v1.7.4), but does not contain package github.com/gin-gonic/gin/json

To the effect, the latest version of gin used is 1.7.4 , but this version does not contain github.com/gin-gonic/gin/json , so it is replaced with a lower version. Here it is replaced with 1.3.0 ,

C:\Users\sunpengfei.SC\go\src\dbm>go get github.com/gin-gonic/[email protected]
go: downloading github.com/gin-gonic/gin v1.3.0
go: downloading gopkg.in/go-playground/validator.v8 v8.18.2
go get: downgraded github.com/gin-gonic/gin v1.7.4 => v1.3.0
go get: downgraded github.com/swaggo/gin-swagger v1.3.2 => v1.1.0

>go mod tidy
go: downloading github.com/swaggo/gin-swagger v1.1.0
go: downloading gopkg.in/go-playground/assert.v1 v1.2.1
go: finding module for package gopkg.in/gin-gonic/gin.v1
go: finding module for package github.com/betacraft/yaag/gin/v1
go: finding module for package github.com/betacraft/yaag/yaag
go: found github.com/betacraft/yaag/gin/v1 in github.com/betacraft/yaag v1.0.0
go: found github.com/betacraft/yaag/yaag in github.com/betacraft/yaag v1.0.0
go: found gopkg.in/gin-gonic/gin.v1 in gopkg.in/gin-gonic/gin.v1 v1.3.0

Similar Posts: