(c *gin.Context, str string, codes ...int)
| 10 | } |
| 11 | |
| 12 | func ErrorStr(c *gin.Context, str string, codes ...int) { |
| 13 | code := 200 |
| 14 | if len(codes) > 0 { |
| 15 | code = codes[0] |
| 16 | } |
| 17 | c.JSON(code, gin.H{ |
| 18 | "error": str, |
| 19 | }) |
| 20 | } |
| 21 | |
| 22 | func JsonBytes(c *gin.Context, body []byte) { |
| 23 | c.Header("Content-Type", gin.MIMEJSON) |
no outgoing calls
no test coverage detected