diff --git a/volume/local/local.go b/volume/local/local.go index 1c844cf0e3..6bf2aa9015 100644 --- a/volume/local/local.go +++ b/volume/local/local.go @@ -357,7 +357,7 @@ func validateOpts(opts map[string]string) error { return nil } for opt := range opts { - if !validOpts[opt] { + if _, ok := validOpts[opt]; !ok { return validationError(fmt.Sprintf("invalid option key: %q", opt)) } } diff --git a/volume/local/local_unix.go b/volume/local/local_unix.go index 1d25c330da..e8f12c9030 100644 --- a/volume/local/local_unix.go +++ b/volume/local/local_unix.go @@ -22,10 +22,10 @@ import ( var ( oldVfsDir = filepath.Join("vfs", "dir") - validOpts = map[string]bool{ - "type": true, // specify the filesystem type for mount, e.g. nfs - "o": true, // generic mount options - "device": true, // device to mount from + validOpts = map[string]struct{}{ + "type": {}, // specify the filesystem type for mount, e.g. nfs + "o": {}, // generic mount options + "device": {}, // device to mount from } mandatoryOpts = map[string]struct{}{ "device": {}, diff --git a/volume/local/local_windows.go b/volume/local/local_windows.go index 5748681bb0..eb19e79747 100644 --- a/volume/local/local_windows.go +++ b/volume/local/local_windows.go @@ -15,7 +15,7 @@ import ( type optsConfig struct{} var ( - validOpts map[string]bool + validOpts map[string]struct{} mandatoryOpts map[string]struct{} )