Commit 60423690 authored by Daniel Martí's avatar Daniel Martí

Fix all go vet issues

parent 4ab0fef0
...@@ -114,7 +114,7 @@ func RunBulkStat(runs int, threads int, sleepTime time.Duration, files []string) ...@@ -114,7 +114,7 @@ func RunBulkStat(runs int, threads int, sleepTime time.Duration, files []string)
results = append(results, result) results = append(results, result)
if j < runs-1 { if j < runs-1 {
fmt.Printf("Sleeping %.2f seconds\n", sleepTime) fmt.Printf("Sleeping %d seconds\n", sleepTime)
time.Sleep(sleepTime) time.Sleep(sleepTime)
} }
} }
......
...@@ -62,7 +62,11 @@ func ToStatus(err error) Status { ...@@ -62,7 +62,11 @@ func ToStatus(err error) Status {
func toSlice(dest *[]byte, ptr unsafe.Pointer, byteCount uintptr) { func toSlice(dest *[]byte, ptr unsafe.Pointer, byteCount uintptr) {
h := (*reflect.SliceHeader)(unsafe.Pointer(dest)) h := (*reflect.SliceHeader)(unsafe.Pointer(dest))
*h = reflect.SliceHeader{uintptr(ptr), int(byteCount), int(byteCount)} *h = reflect.SliceHeader{
Data: uintptr(ptr),
Len: int(byteCount),
Cap: int(byteCount),
}
} }
func CurrentOwner() *Owner { func CurrentOwner() *Owner {
......
...@@ -50,7 +50,6 @@ func (m *fileSystemMount) mountName() string { ...@@ -50,7 +50,6 @@ func (m *fileSystemMount) mountName() string {
} }
} }
panic("not found") panic("not found")
return ""
} }
func (m *fileSystemMount) setOwner(attr *fuse.Attr) { func (m *fileSystemMount) setOwner(attr *fuse.Attr) {
......
...@@ -139,8 +139,8 @@ func (c *rawBridge) OpenDir(input *fuse.OpenIn, out *fuse.OpenOut) (code fuse.St ...@@ -139,8 +139,8 @@ func (c *rawBridge) OpenDir(input *fuse.OpenIn, out *fuse.OpenOut) (code fuse.St
de := &connectorDir{ de := &connectorDir{
node: node.Node(), node: node.Node(),
stream: append(stream, stream: append(stream,
fuse.DirEntry{fuse.S_IFDIR, "."}, fuse.DirEntry{Mode: fuse.S_IFDIR, Name: "."},
fuse.DirEntry{fuse.S_IFDIR, ".."}), fuse.DirEntry{Mode: fuse.S_IFDIR, Name: ".."}),
rawFS: c, rawFS: c,
} }
h, opened := node.mount.registerFileHandle(node, de, nil, input.Flags) h, opened := node.mount.registerFileHandle(node, de, nil, input.Flags)
......
...@@ -235,7 +235,11 @@ func doBatchForget(server *Server, req *request) { ...@@ -235,7 +235,11 @@ func doBatchForget(server *Server, req *request) {
len(req.arg), wantBytes, in.Count) len(req.arg), wantBytes, in.Count)
} }
h := &reflect.SliceHeader{uintptr(unsafe.Pointer(&req.arg[0])), int(in.Count), int(in.Count)} h := &reflect.SliceHeader{
Data: uintptr(unsafe.Pointer(&req.arg[0])),
Len: int(in.Count),
Cap: int(in.Count),
}
forgets := *(*[]_ForgetOne)(unsafe.Pointer(h)) forgets := *(*[]_ForgetOne)(unsafe.Pointer(h))
for _, f := range forgets { for _, f := range forgets {
......
...@@ -77,7 +77,7 @@ func TestOwnerRoot(t *testing.T) { ...@@ -77,7 +77,7 @@ func TestOwnerRoot(t *testing.T) {
} }
func TestOwnerOverride(t *testing.T) { func TestOwnerOverride(t *testing.T) {
wd, cleanup := setupOwnerTest(t, &nodefs.Options{Owner: &fuse.Owner{42, 43}}) wd, cleanup := setupOwnerTest(t, &nodefs.Options{Owner: &fuse.Owner{Uid: 42, Gid: 43}})
defer cleanup() defer cleanup()
var stat syscall.Stat_t var stat syscall.Stat_t
......
...@@ -336,7 +336,7 @@ func TestUnionFsBasic(t *testing.T) { ...@@ -336,7 +336,7 @@ func TestUnionFsBasic(t *testing.T) {
WriteFile(t, wd+"/mnt/new", "new contents") WriteFile(t, wd+"/mnt/new", "new contents")
if !fileExists(wd + "/rw/new") { if !fileExists(wd + "/rw/new") {
t.Errorf("missing file in rw layer", names) t.Errorf("missing file in rw layer: %s", wd+"/rw/new")
} }
contents := readFromFile(t, wd+"/mnt/new") contents := readFromFile(t, wd+"/mnt/new")
...@@ -345,7 +345,7 @@ func TestUnionFsBasic(t *testing.T) { ...@@ -345,7 +345,7 @@ func TestUnionFsBasic(t *testing.T) {
} }
WriteFile(t, wd+"/mnt/ro1", "promote me") WriteFile(t, wd+"/mnt/ro1", "promote me")
if !fileExists(wd + "/rw/ro1") { if !fileExists(wd + "/rw/ro1") {
t.Errorf("missing file in rw layer", names) t.Errorf("missing file in rw layer: %s", wd+"/mnt/ro1")
} }
err := os.Remove(wd + "/mnt/new") err := os.Remove(wd + "/mnt/new")
......
...@@ -100,7 +100,7 @@ func TestMultiZipFs(t *testing.T) { ...@@ -100,7 +100,7 @@ func TestMultiZipFs(t *testing.T) {
t.Fatalf("Lstat failed: %v", err) t.Fatalf("Lstat failed: %v", err)
} }
if !fi.IsDir() { if !fi.IsDir() {
t.Fatal("expect directory for /zipmount, got %v", fi) t.Fatalf("expect directory for /zipmount, got %v", fi)
} }
// Check that zipfs itself works. // Check that zipfs itself works.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment