fix: struct tag (#932)

* fix: struct tag

* fix: struct tag

* fix: strings conversion

* do not write anything after redirection

* fix table

* fix select
This commit is contained in:
UUBulb
2024-12-31 23:09:58 +08:00
committed by GitHub
parent 553f8e58d4
commit 3216ad43fa
5 changed files with 16 additions and 12 deletions

View File

@@ -197,6 +197,8 @@ func (we *wsError) Error() string {
return fmt.Sprintf(we.msg, we.a...)
}
var errNoop = errors.New("wrote")
func commonHandler[T any](handler handlerFunc[T]) func(*gin.Context) {
return func(c *gin.Context) {
handle(c, handler)
@@ -239,7 +241,9 @@ func handle[T any](c *gin.Context, handler handlerFunc[T]) {
}
return
default:
c.JSON(http.StatusOK, newErrorResponse(err))
if !errors.Is(err, errNoop) {
c.JSON(http.StatusOK, newErrorResponse(err))
}
return
}
}