Commit 6d5f84b0 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Run gofmt.

parent 7aa7dde6
......@@ -18,11 +18,11 @@ func (me *HelloFs) GetAttr(name string, context *fuse.Context) (*os.FileInfo, fu
case "file.txt":
return &os.FileInfo{
Mode: fuse.S_IFREG | 0644, Size: int64(len(name)),
},fuse.OK
}, fuse.OK
case "":
return &os.FileInfo{
Mode: fuse.S_IFDIR | 0755,
},fuse.OK
}, fuse.OK
}
return nil, fuse.ENOENT
}
......
......@@ -90,7 +90,7 @@ type nonseekFs struct {
func (me *nonseekFs) GetAttr(name string, context *Context) (fi *os.FileInfo, status Status) {
if name == "file" {
return &os.FileInfo{ Mode: S_IFREG | 0644 }, OK
return &os.FileInfo{Mode: S_IFREG | 0644}, OK
}
return nil, ENOENT
}
......@@ -110,7 +110,7 @@ func (me *nonseekFs) Open(name string, flags uint32, context *Context) (fuseFile
func TestNonseekable(t *testing.T) {
fs := &nonseekFs{}
fs.Length = 200*1024
fs.Length = 200 * 1024
dir := MakeTempDir()
defer os.RemoveAll(dir)
......
......@@ -163,7 +163,7 @@ func DecodeHandle(handle uint64) (val *Handled) {
if unsafe.Sizeof(val) == 8 {
ptrBits := uintptr(handle & (1<<45 - 1))
check = uint32(handle >> 45)
val = (*Handled)(unsafe.Pointer(ptrBits << 3 + uintptr(baseAddress)))
val = (*Handled)(unsafe.Pointer(ptrBits<<3 + uintptr(baseAddress)))
}
if unsafe.Sizeof(val) == 4 {
val = (*Handled)(unsafe.Pointer(uintptr(handle & ((1 << 32) - 1))))
......
......@@ -698,7 +698,6 @@ func (me *FileSystemConnector) EntryNotify(dir string, name string) Status {
return me.fsInit.EntryNotify(node.NodeId, name)
}
func (me *FileSystemConnector) Notify(path string) Status {
node, rest := me.findLastKnownInode(path)
if len(rest) > 0 {
......@@ -709,4 +708,3 @@ func (me *FileSystemConnector) Notify(path string) Status {
}
return me.fsInit.InodeNotify(&out)
}
......@@ -58,7 +58,7 @@ func (me *ReadonlyFileSystem) Truncate(name string, offset uint64, context *Cont
}
func (me *ReadonlyFileSystem) Open(name string, flags uint32, context *Context) (file File, code Status) {
if flags & O_ANYWRITE != 0 {
if flags&O_ANYWRITE != 0 {
return nil, EPERM
}
// TODO - wrap the File object inside a R/O wrapper too?
......
......@@ -159,7 +159,7 @@ func TestSymlinkPromote(t *testing.T) {
wd, clean := setupUfs(t)
defer clean()
err := os.Mkdir(wd + "/ro/subdir", 0755)
err := os.Mkdir(wd+"/ro/subdir", 0755)
CheckSuccess(err)
err = os.Symlink("/foobar", wd+"/mount/subdir/link")
......@@ -688,7 +688,7 @@ func TestRmRf(t *testing.T) {
CheckSuccess(err)
bin, err := exec.LookPath("rm")
CheckSuccess(err)
cmd := exec.Command(bin, "-rf", wd + "/mount/dir")
cmd := exec.Command(bin, "-rf", wd+"/mount/dir")
err = cmd.Run()
if err != nil {
t.Fatal("rm -rf returned error:", err)
......@@ -868,7 +868,7 @@ func TestDeletedGetAttr(t *testing.T) {
CheckSuccess(err)
defer f.Close()
err = os.Remove(wd+"/mount/file")
err = os.Remove(wd + "/mount/file")
CheckSuccess(err)
if fi, err := f.Stat(); err != nil || !fi.IsRegular() {
......
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