Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of pointers in form binding #1336

Merged
merged 3 commits into from
Apr 26, 2018

Conversation

lokhman
Copy link
Contributor

@lokhman lokhman commented Apr 25, 2018

Useful in case if you need to bind the form to the following structure:

type input struct {
	Field *string `form:"field" binding:"omitempty,max=128"`
}

@codecov
Copy link

codecov bot commented Apr 25, 2018

Codecov Report

Merging #1336 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1336      +/-   ##
==========================================
+ Coverage   98.26%   98.27%   +<.01%     
==========================================
  Files          34       34              
  Lines        1790     1795       +5     
==========================================
+ Hits         1759     1764       +5     
  Misses         25       25              
  Partials        6        6
Impacted Files Coverage Δ
binding/form_mapping.go 98.48% <100%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8c24018...4b57cbe. Read the comment docs.

@thinkerou
Copy link
Member

Please add some unit test cases, thanks!

@lokhman
Copy link
Contributor Author

lokhman commented Apr 26, 2018

@thinkerou All done 😄

@appleboy appleboy added this to the 1.3 milestone Apr 26, 2018
@appleboy
Copy link
Member

@thinkerou Can you also help to review this PR?

Copy link
Member

@appleboy appleboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thinkerou
Copy link
Member

thinkerou commented Apr 26, 2018

OK @appleboy LGTM.

@appleboy appleboy merged commit 2282be0 into gin-gonic:master Apr 26, 2018
@lokhman lokhman deleted the features/form-binding-pointers branch April 26, 2018 14:20
tonyhhyip pushed a commit to ysitd-cloud/gin that referenced this pull request Apr 28, 2018
* Add support of pointers in form binding

* Add tests for pointer form binding

(cherry picked from commit 2282be0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants