mirror of
https://github.com/syncthing/syncthing.git
synced 2025-12-23 22:18:14 -05:00
fix(config): zero filesystemtype is "basic" (#10038)
For legacy purposes
This commit is contained in:
@@ -16,18 +16,31 @@ const (
|
||||
)
|
||||
|
||||
func (t FilesystemType) ToFS() fs.FilesystemType {
|
||||
if t == "" {
|
||||
// legacy compat, zero value means basic
|
||||
return fs.FilesystemTypeBasic
|
||||
}
|
||||
return fs.FilesystemType(string(t))
|
||||
}
|
||||
|
||||
func (t FilesystemType) String() string {
|
||||
if t == "" {
|
||||
// legacy compat, zero value means basic
|
||||
return string(FilesystemTypeBasic)
|
||||
}
|
||||
return string(t)
|
||||
}
|
||||
|
||||
func (t FilesystemType) MarshalText() ([]byte, error) {
|
||||
return []byte(t), nil
|
||||
return []byte(t.String()), nil
|
||||
}
|
||||
|
||||
func (t *FilesystemType) UnmarshalText(bs []byte) error {
|
||||
if len(bs) == 0 {
|
||||
// legacy compat, zero value means basic
|
||||
*t = FilesystemTypeBasic
|
||||
return nil
|
||||
}
|
||||
*t = FilesystemType(string(bs))
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user