refactor: panic if error exists (#43)

This commit is contained in:
Eason Lin 2019-02-22 18:16:51 +08:00 committed by GitHub
parent 0c6fcfd3c7
commit ea4ea9de0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -41,7 +41,10 @@ func WrapHandler(h *webdav.Handler) gin.HandlerFunc {
}
index.Execute(c.Writer, s)
case "doc.json":
doc, _ := swag.ReadDoc()
doc, err := swag.ReadDoc()
if err != nil {
panic(err)
}
c.Writer.Write([]byte(doc))
return
default: