1
0
mirror of https://github.com/golang/go synced 2024-11-18 10:54:40 -07:00

internal/lsp: fix incorrect format strings when calling event.Error

I noticed that in a couple places, event.Error was called with a
message containing formatting verb. This was my likely done out of
habit, but is an incorrect use of the API: err is not formatted in the
message but is rather applied as an event label.

Remove the unused formatting verbs.

Change-Id: I52f914da81e338013c7449066e5d9ffa40a0a4c1
Reviewed-on: https://go-review.googlesource.com/c/tools/+/232137
Reviewed-by: Ian Cottrell <iancottrell@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Rob Findley 2020-05-04 15:12:06 -04:00 committed by Robert Findley
parent 1d9c21a7db
commit 9bfbc38543
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ func (s *Server) runGenerate(ctx context.Context, dir string, recursive bool) {
stderr := io.MultiWriter(er, wc)
err := inv.RunPiped(ctx, er, stderr)
if err != nil {
event.Error(ctx, "generate: command error: %v", err, tag.Directory.Of(dir))
event.Error(ctx, "generate: command error", err, tag.Directory.Of(dir))
if !xerrors.Is(err, context.Canceled) {
s.client.ShowMessage(ctx, &protocol.ShowMessageParams{
Type: protocol.Error,

View File

@ -328,7 +328,7 @@ func (f *Forwarder) connectToRemote(ctx context.Context) (net.Conn, error) {
if err != nil {
// If the ownership check itself failed, we fail open but log an error to
// the user.
event.Error(ctx, "unable to check daemon socket owner, failing open: %v", err)
event.Error(ctx, "unable to check daemon socket owner, failing open", err)
} else if !ok {
// We succesfully checked that the socket is not owned by us, we fail
// closed.