mirror of
https://github.com/rclone/rclone.git
synced 2025-08-16 08:38:11 +02:00
fs: create fs.Enum for easy creation of parameters from a list of choices
This commit is contained in:
@ -24,8 +24,7 @@ func camelToSnake(in string) string {
|
||||
// StringToInterface turns in into an interface{} the same type as def
|
||||
func StringToInterface(def interface{}, in string) (newValue interface{}, err error) {
|
||||
typ := reflect.TypeOf(def)
|
||||
switch typ.Kind() {
|
||||
case reflect.String:
|
||||
if typ.Kind() == reflect.String && typ.Name() == "string" {
|
||||
// Pass strings unmodified
|
||||
return in, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user