mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-25 23:21:54 +08:00
Remove errors pointed out by govet
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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")
|
||||
}
|
||||
|
||||
|
@ -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():
|
||||
|
@ -64,8 +64,6 @@ func (dht *IpfsDHT) handleNewMessage(s inet.Stream) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// sendRequest sends out a request, but also makes sure to
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@ -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()
|
||||
@ -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)
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user