mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-07 15:10:01 +08:00
simplify code with http.Flusher type conversion (#325)
* simplify code with http.Flusher type conversion * simplify code with http.Flusher type conversion, better version
This commit is contained in:
@@ -92,9 +92,8 @@ func TestCryptionHandlerFlush(t *testing.T) {
|
||||
req := httptest.NewRequest(http.MethodGet, "/any", nil)
|
||||
handler := CryptionHandler(aesKey)(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write([]byte(respText))
|
||||
|
||||
flusher, ok := w.(http.Flusher)
|
||||
assert.Equal(t, ok, true)
|
||||
assert.True(t, ok)
|
||||
flusher.Flush()
|
||||
}))
|
||||
recorder := httptest.NewRecorder()
|
||||
|
||||
Reference in New Issue
Block a user