Skip to content

Commit 4234de2

Browse files
committed
Fix docs
1 parent d76d893 commit 4234de2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

example_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ func ExampleDial() {
6060
c.Close(websocket.StatusNormalClosure, "")
6161
}
6262

63-
func ExampleWriteOnly() {
63+
// This example shows how to correctly handle a WebSocket connection
64+
// on which you will only write and do not expect to read data messages.
65+
func Example_writeOnly() {
6466
fn := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
6567
c, err := websocket.Accept(w, r, websocket.AcceptOptions{})
6668
if err != nil {

websocket.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ func (c *Conn) handleControl(ctx context.Context, h header) error {
302302
// You must read from the connection for close frames to be read.
303303
// If you do not expect any data messages from the peer, just call
304304
// Reader in a separate goroutine and close the connection with StatusPolicyViolation
305-
// when it returns. See the WriteOnly example.
305+
// when it returns. See the writeOnly example.
306306
//
307307
// Only one Reader may be open at a time.
308308
//

0 commit comments

Comments
 (0)