From 8a21f005477766f8ccb0b76107a58e61f9baa8c9 Mon Sep 17 00:00:00 2001 From: David Cai Date: Wed, 31 Jan 2018 10:32:48 +0800 Subject: [PATCH] feat: handle panic in json-mask package --- middleware.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/middleware.go b/middleware.go index 6a1e167..a1ab583 100644 --- a/middleware.go +++ b/middleware.go @@ -22,12 +22,6 @@ func (s *Sender) Send(ctx *gear.Context, code int, data interface{}) (err error) return ctx.JSON(code, data) } - defer func() { - if recover() != nil { - err = ctx.JSON(code, data) - } - }() - maskedData, err := mask.Mask(data, ctx.Query(s.query)) if err != nil {