Skip to content

Commit

Permalink
Remove errors pointed out by govet
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
  • Loading branch information
Kubuxu committed Jun 14, 2016
1 parent 79e9bd8 commit a2cd3eb
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cmd/ipfs/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
managefd, _, _ := req.Option(adjustFDLimitKwd).Bool()
if managefd {
if err := fileDescriptorCheck(); err != nil {
log.Error("setting file descriptor limit: %s", err)
log.Errorf("setting file descriptor limit: %s", err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/ipfs/ulimit_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func init() {
if val := os.Getenv("IPFS_FD_MAX"); val != "" {
n, err := strconv.Atoi(val)
if err != nil {
log.Error("bad value for IPFS_FD_MAX: %s", err)
log.Errorf("bad value for IPFS_FD_MAX: %s", err)
} else {
ipfsFileDescNum = uint64(n)
}
Expand Down
2 changes: 1 addition & 1 deletion commands/files/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ anotherfile
t.Fatalf("expected to be able to read 12 bytes from file: %s (got %d)", err, n)
}
if err := mpf.Close(); err != nil {
t.Fatal("should be able to close file: %s", err)
t.Fatalf("should be able to close file: %s", err)
}

// test properties of symlink created from fourth part (symlink)
Expand Down
2 changes: 1 addition & 1 deletion merkledag/merkledag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func SubtestNodeStat(t *testing.T, n *Node) {
}

if expected != *actual {
t.Error("n.Stat incorrect.\nexpect: %s\nactual: %s", expected, actual)
t.Errorf("n.Stat incorrect.\nexpect: %s\nactual: %s", expected, actual)
} else {
fmt.Printf("n.Stat correct: %s\n", actual)
}
Expand Down
2 changes: 1 addition & 1 deletion mfs/ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func Mkdir(r *Root, pth string, mkparents bool, flush bool) error {
func Lookup(r *Root, path string) (FSNode, error) {
dir, ok := r.GetValue().(*Directory)
if !ok {
log.Error("root not a dir: %#v", r.GetValue())
log.Errorf("root not a dir: %#v", r.GetValue())
return nil, errors.New("root was not a directory")
}

Expand Down
2 changes: 1 addition & 1 deletion mfs/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func (np *Republisher) Run() {
pubnowresp <- struct{}{}
}
if err != nil {
log.Error("republishRoot error: %s", err)
log.Errorf("republishRoot error: %s", err)
}

case <-np.ctx.Done():
Expand Down
2 changes: 0 additions & 2 deletions routing/dht/dht_net.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ func (dht *IpfsDHT) handleNewMessage(s inet.Stream) {
return
}
}

return
}

// sendRequest sends out a request, but also makes sure to
Expand Down
6 changes: 3 additions & 3 deletions routing/dht/dht_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func TestProvides(t *testing.T) {
t.Fatal(err)
}
if !bytes.Equal(bits.GetValue(), v) {
t.Fatal("didn't store the right bits (%s, %s)", k, v)
t.Fatalf("didn't store the right bits (%s, %s)", k, v)
}
}

Expand Down Expand Up @@ -289,7 +289,7 @@ func waitForWellFormedTables(t *testing.T, dhts []*IpfsDHT, minPeers, avgPeers i

func printRoutingTables(dhts []*IpfsDHT) {
// the routing tables should be full now. let's inspect them.
fmt.Println("checking routing table of %d", len(dhts))
fmt.Printf("checking routing table of %d\n", len(dhts))
for _, dht := range dhts {
fmt.Printf("checking routing table of %s\n", dht.self)
dht.routingTable.Print()
Expand Down Expand Up @@ -487,7 +487,7 @@ func TestProvidesMany(t *testing.T) {
t.Fatal(err)
}
if !bytes.Equal(bits.GetValue(), v) {
t.Fatal("didn't store the right bits (%s, %s)", k, v)
t.Fatalf("didn't store the right bits (%s, %s)", k, v)
}

t.Logf("announcing provider for %s", k)
Expand Down
1 change: 0 additions & 1 deletion unixfs/io/dagreader.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ func (dr *DagReader) Seek(offset int64, whence int) (int64, error) {
default:
return 0, errors.New("invalid whence")
}
return 0, nil
}

// readSeekNopCloser wraps a bytes.Reader to implement ReadSeekCloser
Expand Down

0 comments on commit a2cd3eb

Please sign in to comment.