Open
Description
Hello @danslimmon, @DennyLoko, @sidbusy, @stxml, @dgsi, @kongfei605, @LeBronoMars and @tsirolnik,
First of all, sorry for delay in answering, I was just a little bit busy with university (final exams).
Regarding all the following issues (#629, #633, #636, danslimmon#1 and #661), here is what I suggest:
- Because Gin now has the API frozen (doesn't allow breaking changes in functions or behavior), I can't change the behavior of
c.BindWith()
(allow to custom the error handle #661, @sidbusy), however I like the idea, so keep reading. - I'll review and merge the PR Content-Type is forced to text/plain when context.Bind() fails #633 with the fix Fix code on PR #636 to pass the tests danslimmon/gin#1 (@danslimmon, @DennyLoko).
- I propose to add two function/aliases called:
c.ShouldBindWith()
implementing allow to custom the error handle #661, which will allow custom error managment.c.MustBindWith()
being an alias ofc.BindWith()
and soft deprecating the last one (just a message viafmt.Println
), for a future change of behavior, by movingc.ShouldBindWith()
back toc.BindWith()
.
Because I'm not a native english speaker, maybe the naming of the two new proposed functions sound strange or completely wrong, so I'm open to suggestion about this, and also about everything else in this message.
Hope I did explained correctly. Tell me your thoughts.