Commit 880bc3f0 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Make reflect actually work: use fmt.Sprintf.

parent 90b2a0f3
// FileSystemConnector's implementation of RawFileSystem
package fuse package fuse
// This file contains FileSystemConnector's implementation of
// RawFileSystem
import ( import (
"bytes" "bytes"
"fmt"
"log" "log"
"reflect" "strings"
"time" "time"
"github.com/hanwen/go-fuse/raw" "github.com/hanwen/go-fuse/raw"
...@@ -13,6 +15,7 @@ import ( ...@@ -13,6 +15,7 @@ import (
var _ = log.Println var _ = log.Println
func (c *FileSystemConnector) String() string { func (c *FileSystemConnector) String() string {
if c.rootNode == nil || c.rootNode.mount == nil { if c.rootNode == nil || c.rootNode.mount == nil {
return "go-fuse:unmounted" return "go-fuse:unmounted"
...@@ -21,7 +24,8 @@ func (c *FileSystemConnector) String() string { ...@@ -21,7 +24,8 @@ func (c *FileSystemConnector) String() string {
fs := c.rootNode.mount.fs fs := c.rootNode.mount.fs
name := fs.String() name := fs.String()
if name == "DefaultNodeFileSystem" { if name == "DefaultNodeFileSystem" {
name = reflect.TypeOf(fs).Name() name = fmt.Sprintf("%T", fs)
name = strings.TrimLeft(name, "*")
} }
return name return name
} }
......
package fuse package fuse
import ( import (
"fmt"
"log" "log"
"path/filepath" "path/filepath"
"reflect" "strings"
"sync" "sync"
) )
...@@ -90,7 +91,8 @@ func (fs *PathNodeFs) OnUnmount() { ...@@ -90,7 +91,8 @@ func (fs *PathNodeFs) OnUnmount() {
func (fs *PathNodeFs) String() string { func (fs *PathNodeFs) String() string {
name := fs.fs.String() name := fs.fs.String()
if name == "DefaultFileSystem" { if name == "DefaultFileSystem" {
name = reflect.TypeOf(fs.fs).Name() name = fmt.Sprintf("%T", fs.fs)
name = strings.TrimLeft(name, "*")
} }
return name return name
} }
......
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