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 {
|
func (t FilesystemType) ToFS() fs.FilesystemType {
|
||||||
|
if t == "" {
|
||||||
|
// legacy compat, zero value means basic
|
||||||
|
return fs.FilesystemTypeBasic
|
||||||
|
}
|
||||||
return fs.FilesystemType(string(t))
|
return fs.FilesystemType(string(t))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t FilesystemType) String() string {
|
func (t FilesystemType) String() string {
|
||||||
|
if t == "" {
|
||||||
|
// legacy compat, zero value means basic
|
||||||
|
return string(FilesystemTypeBasic)
|
||||||
|
}
|
||||||
return string(t)
|
return string(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t FilesystemType) MarshalText() ([]byte, error) {
|
func (t FilesystemType) MarshalText() ([]byte, error) {
|
||||||
return []byte(t), nil
|
return []byte(t.String()), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *FilesystemType) UnmarshalText(bs []byte) error {
|
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))
|
*t = FilesystemType(string(bs))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user