Commit 00bf79b1 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Run gofmt in example/

parent b3ea7e6b
......@@ -38,7 +38,7 @@ func main() {
EntryTimeout: 1.0,
AttrTimeout: 1.0,
NegativeTimeout: 1.0,
Owner: fuse.CurrentOwner(),
Owner: fuse.CurrentOwner(),
},
UpdateOnMount: true,
}
......
......@@ -75,21 +75,21 @@ func Analyze(times []float64) {
avg := tot / n
variance := 0.0
for _, v := range times {
variance += (v - avg)*(v - avg)
variance += (v - avg) * (v - avg)
}
variance /= n
stddev := math.Sqrt(variance)
median := sorted[len(times)/2]
perc90 := sorted[int(n * 0.9)]
perc10 := sorted[int(n * 0.1)]
perc90 := sorted[int(n*0.9)]
perc10 := sorted[int(n*0.1)]
fmt.Printf(
"%d samples\n" +
"avg %.2f ms 2sigma %.2f " +
"median %.2fms\n" +
"10%%tile %.2fms, 90%%tile %.2fms\n",
"%d samples\n"+
"avg %.2f ms 2sigma %.2f "+
"median %.2fms\n"+
"10%%tile %.2fms, 90%%tile %.2fms\n",
len(times), avg, 2*stddev, median, perc10, perc90)
}
......
......@@ -18,11 +18,11 @@ func (me *HelloFs) GetAttr(name string) (*os.FileInfo, fuse.Status) {
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
}
......@@ -30,7 +30,7 @@ func (me *HelloFs) GetAttr(name string) (*os.FileInfo, fuse.Status) {
func (me *HelloFs) OpenDir(name string) (c chan fuse.DirEntry, code fuse.Status) {
if name == "" {
c = make(chan fuse.DirEntry, 1)
c <- fuse.DirEntry{Name: "file.txt",Mode: fuse.S_IFREG}
c <- fuse.DirEntry{Name: "file.txt", Mode: fuse.S_IFREG}
close(c)
return c, fuse.OK
}
......@@ -41,7 +41,7 @@ func (me *HelloFs) Open(name string, flags uint32) (file fuse.File, code fuse.St
if name != "file.txt" {
return nil, fuse.ENOENT
}
if flags & fuse.O_ANYWRITE != 0 {
if flags&fuse.O_ANYWRITE != 0 {
return nil, fuse.EPERM
}
return fuse.NewReadOnlyFile([]byte(name)), fuse.OK
......
......@@ -27,7 +27,7 @@ func main() {
fmt.Printf("Mount fail: %v\n", err)
os.Exit(1)
}
state.Debug = *debug
state.Loop(true)
}
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