fix(config): zero filesystemtype is "basic" (#10038)

For legacy purposes
This commit is contained in:
Jakob Borg
2025-04-04 12:28:39 -07:00
committed by GitHub
parent f7c8efd93c
commit 2301f72c5b

View File

@@ -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
}