wscat: check upgrade error.

This commit is contained in:
Arseny Balobanov 2020-04-04 05:22:01 +03:00
parent 75cb0a68fc
commit ad2695a092

View file

@ -4,7 +4,6 @@ import (
"bytes"
"context"
"io"
"log"
"net/http"
"net/http/httptest"
"os"
@ -96,10 +95,7 @@ func TestWScat(t *testing.T) {
var received, sent [][]byte
h := func(w http.ResponseWriter, r *http.Request) {
c, err := upgrader.Upgrade(w, r, nil)
if err != nil {
log.Print("upgrade:", err)
return
}
require.NoError(t, err)
defer func() { _ = c.Close() }()
for {