x/tools: remove dead code

These unused functions and methods were discovered by a (work in
progress) dead function analyzer.

Change-Id: Iaa9c5fd4f06bdcd5d7c6e194bcc24d6b37df8f4c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/639675
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Alan Donovan 2025-01-01 23:15:35 -05:00
commit dd2bc6543e
3 changed files with 0 additions and 28 deletions

View file

@ -112,15 +112,6 @@ func (a *async) done() {
close(a.ready)
}
func (a *async) isDone() bool {
select {
case <-a.ready:
return true
default:
return false
}
}
func (a *async) wait() error {
<-a.ready
err := <-a.firstErr

View file

@ -8,12 +8,7 @@
package jsonrpc2
import (
"errors"
"net"
)
var errClosed = net.ErrClosed
func isErrClosed(err error) bool {
return errors.Is(err, errClosed)
}

View file

@ -9,22 +9,8 @@ package jsonrpc2
import (
"errors"
"strings"
)
// errClosed is an error with the same string as net.ErrClosed,
// which was added in Go 1.16.
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 compatibility with
// (otherwise-unsupported) older Go versions.
//
// 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.
return strings.HasSuffix(err.Error(), "use of closed network connection")
}