From 64fb435a66a2d34ede23a12f4a54f05d7420dcf9 Mon Sep 17 00:00:00 2001 From: Leul Tewodros Agonafer <107800362+LeulTew@users.noreply.github.com> Date: Fri, 18 Sep 2026 09:24:16 +0300 Subject: [PATCH] test(binding): format map pointer cases --- binding/form_mapping_test.go | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/binding/form_mapping_test.go b/binding/form_mapping_test.go index 5f545c83..98c07cd7 100644 --- a/binding/form_mapping_test.go +++ b/binding/form_mapping_test.go @@ -198,16 +198,28 @@ func TestMapFormWithTagMapPointer(t *testing.T) { {"empty string map", new(map[string]string), map[string][]string{}, new(map[string]string), nil}, {"empty string slice map", new(map[string][]string), map[string][]string{}, new(map[string][]string), nil}, {"nil string map", new(map[string]string), form, &map[string]string{"foo": "last", "empty": ""}, nil}, - {"nil string slice map", new(map[string][]string), form, - &map[string][]string{"foo": {"first", "last"}, "empty": {""}}, nil}, + { + "nil string slice map", new(map[string][]string), form, + &map[string][]string{"foo": {"first", "last"}, "empty": {""}}, nil, + }, {"unsupported value", new(map[string]int), form, new(map[string]int), ErrConvertToMapString}, {"unsupported slice value", new(map[string][]int), form, new(map[string][]int), ErrConvertMapStringSlice}, {"unsupported named map", new(namedMap), form, new(namedMap), ErrConvertToMapString}, {"unsupported named slice map", new(namedSliceMap), form, new(namedSliceMap), ErrConvertMapStringSlice}, - {"string map by value", map[string]string{"foo": "stale", "keep": "value"}, form, - map[string]string{"foo": "last", "empty": "", "keep": "value"}, nil}, - {"string slice map by value", map[string][]string{"foo": {"stale"}, "keep": {"value"}}, form, - map[string][]string{"foo": {"first", "last"}, "empty": {""}, "keep": {"value"}}, nil}, + { + "string map by value", + map[string]string{"foo": "stale", "keep": "value"}, + form, + map[string]string{"foo": "last", "empty": "", "keep": "value"}, + nil, + }, + { + "string slice map by value", + map[string][]string{"foo": {"stale"}, "keep": {"value"}}, + form, + map[string][]string{"foo": {"first", "last"}, "empty": {""}, "keep": {"value"}}, + nil, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {