aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/fuse
diff options
context:
space:
mode:
authorYondon Fu <yondon.fu@gmail.com>2017-12-19 06:17:41 +0800
committerYondon Fu <yondon.fu@gmail.com>2017-12-19 06:17:41 +0800
commit3857cdc267e3192697f561df0a0f827f65dfb6b5 (patch)
tree401c52c4972a68229ea283a394a0b0a5f3cfdc8e /swarm/fuse
parenta5330fe0c569b75cb8a524f60f7e8dc06498262b (diff)
parentfe070ab5c32702033489f1b9d1655ea1b894c29e (diff)
downloaddexon-3857cdc267e3192697f561df0a0f827f65dfb6b5.tar
dexon-3857cdc267e3192697f561df0a0f827f65dfb6b5.tar.gz
dexon-3857cdc267e3192697f561df0a0f827f65dfb6b5.tar.bz2
dexon-3857cdc267e3192697f561df0a0f827f65dfb6b5.tar.lz
dexon-3857cdc267e3192697f561df0a0f827f65dfb6b5.tar.xz
dexon-3857cdc267e3192697f561df0a0f827f65dfb6b5.tar.zst
dexon-3857cdc267e3192697f561df0a0f827f65dfb6b5.zip
Merge branch 'master' into abi-offset-fixed-arrays
Diffstat (limited to 'swarm/fuse')
-rw-r--r--swarm/fuse/fuse_file.go11
-rw-r--r--swarm/fuse/swarmfs_test.go10
2 files changed, 10 insertions, 11 deletions
diff --git a/swarm/fuse/fuse_file.go b/swarm/fuse/fuse_file.go
index 32c85d02f..c94a0773f 100644
--- a/swarm/fuse/fuse_file.go
+++ b/swarm/fuse/fuse_file.go
@@ -19,15 +19,16 @@
package fuse
import (
+ "errors"
+ "io"
+ "os"
+ "sync"
+
"bazil.org/fuse"
"bazil.org/fuse/fs"
- "errors"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/swarm/storage"
"golang.org/x/net/context"
- "io"
- "os"
- "sync"
)
const (
@@ -87,7 +88,7 @@ func (file *SwarmFile) Attr(ctx context.Context, a *fuse.Attr) error {
if err != nil {
log.Warn("Couldnt get size of file %s : %v", file.path, err)
}
- file.fileSize = int64(size)
+ file.fileSize = size
}
a.Size = uint64(file.fileSize)
return nil
diff --git a/swarm/fuse/swarmfs_test.go b/swarm/fuse/swarmfs_test.go
index 93f1d4c2f..42af36345 100644
--- a/swarm/fuse/swarmfs_test.go
+++ b/swarm/fuse/swarmfs_test.go
@@ -95,7 +95,7 @@ func mountDir(t *testing.T, api *api.Api, files map[string]fileInfo, bzzHash str
}
// Test listMounts
- if found == false {
+ if !found {
t.Fatalf("Error getting mounts information for %v: %v", mountDir, err)
}
@@ -185,10 +185,8 @@ func isDirEmpty(name string) bool {
defer f.Close()
_, err = f.Readdirnames(1)
- if err == io.EOF {
- return true
- }
- return false
+
+ return err == io.EOF
}
type testAPI struct {
@@ -388,7 +386,7 @@ func (ta *testAPI) seekInMultiChunkFile(t *testing.T) {
d.Read(contents)
finfo := files["1.txt"]
- if bytes.Compare(finfo.contents[:6024][5000:], contents) != 0 {
+ if !bytes.Equal(finfo.contents[:6024][5000:], contents) {
t.Fatalf("File seek contents mismatch")
}
d.Close()