From ef64c539fa1e330f24d409e7fc8d3b5b3efa9bfb Mon Sep 17 00:00:00 2001 From: kouler Date: Sun, 8 Jan 2023 13:06:38 +0000 Subject: [PATCH] internal/jsonrpc2_v2: fix typos Change-Id: I96ad3f8fdb675bdb249934d92fd5d01d28c7dd6b GitHub-Last-Rev: 969dfc7945b6199ee4b28a04c48e8bbe45f4df7b GitHub-Pull-Request: golang/tools#421 Reviewed-on: https://go-review.googlesource.com/c/tools/+/461075 Reviewed-by: Cherry Mui Run-TryBot: Bryan Mills Auto-Submit: Bryan Mills TryBot-Result: Gopher Robot gopls-CI: kokoro Reviewed-by: Bryan Mills --- internal/jsonrpc2/conn.go | 4 ++-- internal/jsonrpc2/serve.go | 2 +- internal/jsonrpc2/serve_pre116.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/jsonrpc2/conn.go b/internal/jsonrpc2/conn.go index 8f1c94e..df91550 100644 --- a/internal/jsonrpc2/conn.go +++ b/internal/jsonrpc2/conn.go @@ -156,11 +156,11 @@ func (c *Connection) updateInFlight(f func(*inFlightState)) { } } -// idle reports whether the connction is in a state with no pending calls or +// idle reports whether the connection is in a state with no pending calls or // notifications. // // If idle returns true, the readIncoming goroutine may still be running, -// but no other goroutines are doing work on behalf of the connnection. +// but no other goroutines are doing work on behalf of the connection. func (s *inFlightState) idle() bool { return len(s.outgoingCalls) == 0 && s.outgoingNotifications == 0 && s.incoming == 0 && !s.handlerRunning } diff --git a/internal/jsonrpc2/serve.go b/internal/jsonrpc2/serve.go index bda5d71..e075aac 100644 --- a/internal/jsonrpc2/serve.go +++ b/internal/jsonrpc2/serve.go @@ -183,7 +183,7 @@ func (l *idleListener) Accept(ctx context.Context) (io.ReadWriteCloser, error) { // In theory the timeout could have raced with an unrelated error return // from Accept. However, ErrIdleTimeout is arguably still valid (since we // would have closed due to the timeout independent of the error), and the - // harm from returning a spurious ErrIdleTimeout is negliglible anyway. + // harm from returning a spurious ErrIdleTimeout is negligible anyway. } return nil, ErrIdleTimeout diff --git a/internal/jsonrpc2/serve_pre116.go b/internal/jsonrpc2/serve_pre116.go index aae0ad0..01b315f 100644 --- a/internal/jsonrpc2/serve_pre116.go +++ b/internal/jsonrpc2/serve_pre116.go @@ -19,10 +19,10 @@ var errClosed = errors.New("use of closed network connection") // isErrClosed reports whether err ends in the same string as errClosed. func isErrClosed(err error) bool { // As of Go 1.16, this could be 'errors.Is(err, net.ErrClosing)', but - // unfortunately gopls still requires compatiblity with + // unfortunately gopls still requires compatibility with // (otherwise-unsupported) older Go versions. // - // In the meantime, this error strirng has not changed on any supported Go + // In the meantime, this error string has not changed on any supported Go // version, and is not expected to change in the future. // This is not ideal, but since the worst that could happen here is some // superfluous logging, it is acceptable.