Skip to content

Commit 1453732

Browse files
committed
fix(http): remove unused type assertion
1 parent dc6c2ff commit 1453732

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/json_request_body.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ func (j *jsonReqBody) Read(p []byte) (n int, err error) {
3838
defer func() {
3939
r := recover()
4040
if r != nil {
41-
switch r.(type) {
41+
switch e := r.(type) {
4242
case error:
43-
_ = pw.CloseWithError(r.(error))
43+
_ = pw.CloseWithError(e)
4444
default:
4545
_ = pw.CloseWithError(errors.New("panic in json encoding routing"))
4646
}

0 commit comments

Comments
 (0)