Skip to content

Commit 9a0d241

Browse files
committed
Remove accidental x/net/websocket import
1 parent 96cf17a commit 9a0d241

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

json.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"encoding/json"
66

7-
"golang.org/x/net/websocket"
87
"golang.org/x/xerrors"
98
)
109

@@ -15,7 +14,7 @@ func ReadJSON(ctx context.Context, c *Conn, v interface{}) error {
1514
return xerrors.Errorf("failed to read json: %w", err)
1615
}
1716

18-
if typ != websocket.TextFrame {
17+
if typ != Text {
1918
return xerrors.Errorf("unexpected frame type for json (expected TextFrame): %v", typ)
2019
}
2120

@@ -32,7 +31,7 @@ func ReadJSON(ctx context.Context, c *Conn, v interface{}) error {
3231

3332
// WriteJSON writes the json message v into c.
3433
func WriteJSON(ctx context.Context, c *Conn, v interface{}) error {
35-
w := c.MessageWriter(websocket.TextFrame)
34+
w := c.MessageWriter(Text)
3635
w.SetContext(ctx)
3736

3837
e := json.NewEncoder(w)

0 commit comments

Comments
 (0)