Skip to content

fix(bind): convert named string map keys before insertion - #3216

Open
highcloudwind wants to merge 1 commit into
labstack:masterfrom
highcloudwind:my_feature
Open

highcloudwind wants to merge 1 commit into
labstack:masterfrom
highcloudwind:my_feature

Conversation

@highcloudwind

Copy link
Copy Markdown

bindData accepts destination maps with any string-kind key, but inserts a plain string reflect.Value. Binding into map[NamedString]string therefore panics because the value is not assignable to the named key type.

Convert each incoming key to the destination map's key type before insertion. Regression cases cover string, string-slice and interface values, including allocation of nil destination maps.

Signed-off-by: highcloudwind <pengwenguohuaibi@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant