From d7d4e06caa3d7c15a0f41740f069816d05c0278b Mon Sep 17 00:00:00 2001 From: shenpengfeng Date: Fri, 22 Nov 2024 21:37:06 +0800 Subject: [PATCH] chore: fix some comments (#801) Signed-off-by: shenpengfeng --- context-aware-reader.md | 2 +- context.md | 2 +- websockets/v1/vendor/github.com/gorilla/websocket/proxy.go | 2 +- websockets/v2/vendor/github.com/gorilla/websocket/proxy.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/context-aware-reader.md b/context-aware-reader.md index ab0b34189..7827521d8 100644 --- a/context-aware-reader.md +++ b/context-aware-reader.md @@ -46,7 +46,7 @@ The `Reader`'s `Read` method will read the contents it has into a `[]byte` that So rather than reading everything, we could: - - Supply a fixed-size byte array that doesnt fit all the contents + - Supply a fixed-size byte array that doesn't fit all the contents - Send a cancel signal - Try and read again and this should return an error with 0 bytes read diff --git a/context.md b/context.md index c9cb1bab9..3a4d0609e 100644 --- a/context.md +++ b/context.md @@ -279,7 +279,7 @@ One of the main points of `context` is that it is a consistent way of offering c From the [Go Blog: Context](https://blog.golang.org/context) again: -> At Google, we require that Go programmers pass a Context parameter as the first argument to every function on the call path between incoming and outgoing requests. This allows Go code developed by many different teams to interoperate well. It provides simple control over timeouts and cancelation and ensures that critical values like security credentials transit Go programs properly. +> At Google, we require that Go programmers pass a Context parameter as the first argument to every function on the call path between incoming and outgoing requests. This allows Go code developed by many different teams to interoperate well. It provides simple control over timeouts and cancellation and ensures that critical values like security credentials transit Go programs properly. (Pause for a moment and think of the ramifications of every function having to send in a context, and the ergonomics of that.) diff --git a/websockets/v1/vendor/github.com/gorilla/websocket/proxy.go b/websockets/v1/vendor/github.com/gorilla/websocket/proxy.go index bf2478e43..0e852d0f4 100644 --- a/websockets/v1/vendor/github.com/gorilla/websocket/proxy.go +++ b/websockets/v1/vendor/github.com/gorilla/websocket/proxy.go @@ -59,7 +59,7 @@ func (hpd *httpProxyDialer) Dial(network string, addr string) (net.Conn, error) return nil, err } - // Read response. It's OK to use and discard buffered reader here becaue + // Read response. It's OK to use and discard buffered reader here because // the remote server does not speak until spoken to. br := bufio.NewReader(conn) resp, err := http.ReadResponse(br, connectReq) diff --git a/websockets/v2/vendor/github.com/gorilla/websocket/proxy.go b/websockets/v2/vendor/github.com/gorilla/websocket/proxy.go index bf2478e43..0e852d0f4 100644 --- a/websockets/v2/vendor/github.com/gorilla/websocket/proxy.go +++ b/websockets/v2/vendor/github.com/gorilla/websocket/proxy.go @@ -59,7 +59,7 @@ func (hpd *httpProxyDialer) Dial(network string, addr string) (net.Conn, error) return nil, err } - // Read response. It's OK to use and discard buffered reader here becaue + // Read response. It's OK to use and discard buffered reader here because // the remote server does not speak until spoken to. br := bufio.NewReader(conn) resp, err := http.ReadResponse(br, connectReq)