-
Notifications
You must be signed in to change notification settings - Fork 8k
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 BindXML AND ShouldBindXML #1484 #1485
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1485 +/- ##
==========================================
+ Coverage 99.15% 99.15% +<.01%
==========================================
Files 36 36
Lines 1890 1894 +4
==========================================
+ Hits 1874 1878 +4
Misses 13 13
Partials 3 3
Continue to review full report at Codecov.
|
Hi @syssam can you add one demo example using ShouldBindXML/BindXML? thanks! |
README.md
Outdated
} | ||
} else { | ||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if err := c.ShouldBindXML(&xml); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
if xml.User != "manu" || xml.Password != "123" {
c.JSON(http.StatusUnauthorized, gin.H{"status": "unauthorized"})
return
}
c.JSON(http.StatusOK, gin.H{"status": "you are logged in"})
more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed with @appleboy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make a new pr change these case? @appleboy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@syssam Why need to make a new PR? I think you can change in this PR. otherwise LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@syssam you should change the code and git commit and git rebase your commit message, not new pull request. If you not know git rebase usage, you should see my issue thinkerou/thinkerou#25 (comment) (sorry, Chinese issue)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks! @syssam
Add BindXML AND ShouldBindXML gin-gonic#1484
Add BindXML AND ShouldBindXML #1484