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 BindXML AND ShouldBindXML #1484 #1485

Merged
merged 5 commits into from
Aug 17, 2018
Merged

Conversation

syssam
Copy link
Contributor

@syssam syssam commented Aug 14, 2018

Add BindXML AND ShouldBindXML #1484

@codecov
Copy link

codecov bot commented Aug 14, 2018

Codecov Report

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

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
context.go 99.48% <100%> (ø) ⬆️

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 bef6c56...ad32864. Read the comment docs.

@appleboy appleboy added this to the 1.4 milestone Aug 14, 2018
@thinkerou
Copy link
Member

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()})
}
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

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

agreed with @appleboy

Copy link
Contributor Author

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

Copy link
Member

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

Copy link
Member

@thinkerou thinkerou Aug 16, 2018

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)

Copy link
Member

@thinkerou thinkerou left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! @syssam

@appleboy appleboy merged commit 40ab9de into gin-gonic:master Aug 17, 2018
salamer pushed a commit to salamer/gin that referenced this pull request Aug 18, 2018
@chainhelen chainhelen mentioned this pull request Aug 24, 2018
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