fix fields not being validated (introduced in 577a536), drop support of list string not starting with hyphen

This commit is contained in:
yusing
2025-01-09 04:21:32 +08:00
parent 7fe03be73f
commit 8bbb5d2e09
2 changed files with 10 additions and 15 deletions

View File

@@ -168,7 +168,7 @@ func TestStringToSlice(t *testing.T) {
})
t.Run("multiline", func(t *testing.T) {
dst := make([]string, 0)
convertible, err := ConvertString(" a\n b\n c", reflect.ValueOf(&dst))
convertible, err := ConvertString("- a\n- b\n- c", reflect.ValueOf(&dst))
ExpectTrue(t, convertible)
ExpectNoError(t, err)
ExpectDeepEqual(t, dst, []string{"a", "b", "c"})