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)
results = append(results, result)
if j < runs-1 {
fmt.Printf("Sleeping %.2f seconds\n", sleepTime)
fmt.Printf("Sleeping %d seconds\n", sleepTime)
time.Sleep(sleepTime)
}
}
......
......@@ -62,7 +62,11 @@ func ToStatus(err error) Status {
func toSlice(dest *[]byte, ptr unsafe.Pointer, byteCount uintptr) {
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 {
......
......@@ -50,7 +50,6 @@ func (m *fileSystemMount) mountName() string {
}
}
panic("not found")
return ""
}
func (m *fileSystemMount) setOwner(attr *fuse.Attr) {
......
......@@ -139,8 +139,8 @@ func (c *rawBridge) OpenDir(input *fuse.OpenIn, out *fuse.OpenOut) (code fuse.St
de := &connectorDir{
node: node.Node(),
stream: append(stream,
fuse.DirEntry{fuse.S_IFDIR, "."},
fuse.DirEntry{fuse.S_IFDIR, ".."}),
fuse.DirEntry{Mode: fuse.S_IFDIR, Name: "."},
fuse.DirEntry{Mode: fuse.S_IFDIR, Name: ".."}),
rawFS: c,
}
h, opened := node.mount.registerFileHandle(node, de, nil, input.Flags)
......
......@@ -235,7 +235,11 @@ func doBatchForget(server *Server, req *request) {
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))
for _, f := range forgets {
......
......@@ -77,7 +77,7 @@ func TestOwnerRoot(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()
var stat syscall.Stat_t
......
......@@ -336,7 +336,7 @@ func TestUnionFsBasic(t *testing.T) {
WriteFile(t, wd+"/mnt/new", "new contents")
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")
......@@ -345,7 +345,7 @@ func TestUnionFsBasic(t *testing.T) {
}
WriteFile(t, wd+"/mnt/ro1", "promote me")
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")
......
......@@ -100,7 +100,7 @@ func TestMultiZipFs(t *testing.T) {
t.Fatalf("Lstat failed: %v", err)
}
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.
......
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