mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 03:18:59 +00:00
lib/fs: Use os.FileMode.String for fs.FileMode (#5302)
This commit is contained in:
parent
830bde2c83
commit
53b0f36be6
@ -79,6 +79,10 @@ type FileInfo interface {
|
|||||||
// FileMode is similar to os.FileMode
|
// FileMode is similar to os.FileMode
|
||||||
type FileMode uint32
|
type FileMode uint32
|
||||||
|
|
||||||
|
func (fm FileMode) String() string {
|
||||||
|
return os.FileMode(fm).String()
|
||||||
|
}
|
||||||
|
|
||||||
// Usage represents filesystem space usage
|
// Usage represents filesystem space usage
|
||||||
type Usage struct {
|
type Usage struct {
|
||||||
Free int64
|
Free int64
|
||||||
|
@ -98,3 +98,11 @@ func TestCanonicalize(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestFileModeString(t *testing.T) {
|
||||||
|
var fm FileMode = 0777
|
||||||
|
exp := "-rwxrwxrwx"
|
||||||
|
if fm.String() != exp {
|
||||||
|
t.Fatalf("Got %v, expected %v", fm.String(), exp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user