fix: handle swag.ReadDoc two-value return
Some checks failed
CI / Build & Test (push) Failing after 29s

This commit is contained in:
MengStack Dev 2026-10-03 04:23:49 +08:00
parent f44fcbafa7
commit 485ae9b329

View File

@ -28,7 +28,7 @@ func SwaggerHandler() gin.HandlerFunc {
isDocJSON := strings.HasSuffix(relPath, "doc.json") isDocJSON := strings.HasSuffix(relPath, "doc.json")
if isDocJSON { if isDocJSON {
doc := swag.ReadDoc() doc, _ := swag.ReadDoc()
c.Header("Content-Type", "application/json; charset=utf-8") c.Header("Content-Type", "application/json; charset=utf-8")
c.Writer.WriteHeader(200) c.Writer.WriteHeader(200)
c.Writer.Write([]byte(doc)) c.Writer.Write([]byte(doc))