We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 028eee5 + defbe23 commit ffd9b40Copy full SHA for ffd9b40
opts/mount.go
@@ -22,6 +22,11 @@ type MountOpt struct {
22
//
23
//nolint:gocyclo
24
func (m *MountOpt) Set(value string) error {
25
+ value = strings.TrimSpace(value)
26
+ if value == "" {
27
+ return errors.New("value is empty")
28
+ }
29
+
30
csvReader := csv.NewReader(strings.NewReader(value))
31
fields, err := csvReader.Read()
32
if err != nil {
opts/mount_test.go
@@ -109,6 +109,10 @@ func TestMountOptErrors(t *testing.T) {
109
tests := []struct {
110
doc, value, expErr string
111
}{
112
+ {
113
+ doc: "empty value",
114
+ expErr: "value is empty",
115
+ },
116
{
117
doc: "missing tmpfs target",
118
value: "type=tmpfs",
0 commit comments