From e947ce2ee4c789a63c3db22d7556547a583db8ad Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 10 Jul 2014 02:59:37 +1000 Subject: [PATCH] Run go vet on everything --- client.go | 2 +- client_test.go | 2 +- dht/closest_nodes.go | 2 +- tracker/udp/udp_tracker.go | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/client.go b/client.go index 15955a80..0c3cdee4 100644 --- a/client.go +++ b/client.go @@ -717,7 +717,7 @@ func (me *Client) connectionLoop(t *torrent, c *connection) error { log.Printf("added %d peers from PEX", len(pexMsg.Added)) }() default: - err = fmt.Errorf("unexpected extended message ID: %s", msg.ExtendedID) + err = fmt.Errorf("unexpected extended message ID: %v", msg.ExtendedID) } default: err = fmt.Errorf("received unknown message type: %#v", msg.Type) diff --git a/client_test.go b/client_test.go index d3dd0156..835ad1f1 100644 --- a/client_test.go +++ b/client_test.go @@ -41,7 +41,7 @@ func TestTorrentInitialState(t *testing.T) { } p := tor.Pieces[0] if len(p.PendingChunkSpecs) != 1 { - t.Fatalf("should only be 1 chunk: %s", p.PendingChunkSpecs) + t.Fatalf("should only be 1 chunk: %v", p.PendingChunkSpecs) } if _, ok := p.PendingChunkSpecs[chunkSpec{ Length: 13, diff --git a/dht/closest_nodes.go b/dht/closest_nodes.go index 2f98e6d6..a677a2e6 100644 --- a/dht/closest_nodes.go +++ b/dht/closest_nodes.go @@ -23,7 +23,7 @@ func (me *nodeMaxHeap) Push(val interface{}) { me.IDs = append(me.IDs, val.(string)) } func (me nodeMaxHeap) Swap(i, j int) { - me.IDs[i], me.IDs[j] = me.IDs[i], me.IDs[j] + me.IDs[i], me.IDs[j] = me.IDs[j], me.IDs[i] } type closestNodesSelector struct { diff --git a/tracker/udp/udp_tracker.go b/tracker/udp/udp_tracker.go index c544aad4..4ca75da7 100644 --- a/tracker/udp/udp_tracker.go +++ b/tracker/udp/udp_tracker.go @@ -124,7 +124,6 @@ func (c *client) Announce(req *tracker.AnnounceRequest) (res tracker.AnnounceRes Port: int(p.Port), }) } - return } func (c *client) write(h *RequestHeader, body interface{}) (err error) {