good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 4234de22 authored by Anmol Sethi's avatar Anmol Sethi
Browse files

Fix docs

parent d76d893a
Branches
Tags
No related merge requests found
...@@ -60,7 +60,9 @@ func ExampleDial() { ...@@ -60,7 +60,9 @@ func ExampleDial() {
c.Close(websocket.StatusNormalClosure, "") c.Close(websocket.StatusNormalClosure, "")
} }
func ExampleWriteOnly() { // This example shows how to correctly handle a WebSocket connection
// on which you will only write and do not expect to read data messages.
func Example_writeOnly() {
fn := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fn := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
c, err := websocket.Accept(w, r, websocket.AcceptOptions{}) c, err := websocket.Accept(w, r, websocket.AcceptOptions{})
if err != nil { if err != nil {
......
...@@ -302,7 +302,7 @@ func (c *Conn) handleControl(ctx context.Context, h header) error { ...@@ -302,7 +302,7 @@ func (c *Conn) handleControl(ctx context.Context, h header) error {
// You must read from the connection for close frames to be read. // You must read from the connection for close frames to be read.
// If you do not expect any data messages from the peer, just call // If you do not expect any data messages from the peer, just call
// Reader in a separate goroutine and close the connection with StatusPolicyViolation // Reader in a separate goroutine and close the connection with StatusPolicyViolation
// when it returns. See the WriteOnly example. // when it returns. See the writeOnly example.
// //
// Only one Reader may be open at a time. // Only one Reader may be open at a time.
// //
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment