Added a convention that sentinel errors go near the top of the file, and applied it

This commit is contained in:
bwilliams committed 2026-10-16 13:23:47 +01:00
1 parent 848edc73e2
commit e32e270db0
5 files changed
+44 -16

No files matched your search

+4 -4
View File
@@ -24,6 +24,10 @@ const clientSendBuffer = 256
// cut short and logged as truncated.
const logMessageLimit = 1 << 10
// errUnsupportedData is returned by readLoop (and a tcpConn's Write) for a
// binary message.
var errUnsupportedData = errors.New("websocket: binary frames are not supported")
// msgConn is the connection a client reads and writes messages on: a
// *websocket.Conn, or a tcpConn for plain TCP clients (see tcp.go).
type msgConn interface {
@@ -51,10 +55,6 @@ type client struct {
closeOnce sync.Once
}
// errUnsupportedData is returned by readLoop (and a tcpConn's Write) for a
// binary message.
var errUnsupportedData = errors.New("websocket: binary frames are not supported")
// newClient creates a client for conn. cancel cancels the context the client
// runs with; the client calls it when it finishes or is closed. The client's
// messages are limited by websocket.message_rate_limit if it is enabled.