mirror of
https://github.com/rclone/rclone.git
synced 2025-06-04 19:24:35 +08:00
fs: fix option types printing incorrectly for backend flags
Before this change backend types were printing incorrectly as the name of the type, not what was defined by the Type() method. This was not working due to not calling the Type() method. However this needed to be defined on a non-pointer type due to the way the options are handled.
This commit is contained in:
@ -17,8 +17,20 @@ type flagger interface {
|
||||
json.Unmarshaler
|
||||
}
|
||||
|
||||
// Check it satisfies the interface
|
||||
var _ flagger = (*SizeSuffix)(nil)
|
||||
// Interface which non-pointer flags must satisfy
|
||||
//
|
||||
// These are from pflag.Value and need to be non-pointer due the the
|
||||
// way the backend flags are inserted into the flags.
|
||||
type flaggerNP interface {
|
||||
String() string
|
||||
Type() string
|
||||
}
|
||||
|
||||
// Check it satisfies the interfaces
|
||||
var (
|
||||
_ flagger = (*SizeSuffix)(nil)
|
||||
_ flaggerNP = SizeSuffix(0)
|
||||
)
|
||||
|
||||
func TestSizeSuffixString(t *testing.T) {
|
||||
for _, test := range []struct {
|
||||
|
Reference in New Issue
Block a user