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 a method to set the indentJsonIndentString used in Context.Indent… #2349

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

add a method to set the indentJsonIndentString used in Context.Indent… #2349

wants to merge 6 commits into from

Conversation

bestgopher
Copy link
Contributor

…edJSON

  • With pull requests:
    • Open your pull request against master
    • Your pull request should have no more than two commits, if not you should squash them.
    • It should pass all tests in the available continuous integration systems such as TravisCI.
    • You should add/modify tests to cover your proposed code changes.
    • If your pull request contains a new feature, please docuHi, I have add a method named IndentJsonIndentSpaceNum for Engine to set number of indented blanks when you use Context.IndentedJSON.We can use it like this:
router := gin.Default()
router.IndentJsonIndentSpaceNum(2)

The serialized string of gin.H {" name ":" test "," age ": 2} is like:

{
  "name":  "test",
  "age": 2
}

There are only 2 spaces in front of the name field.ment it on the README.

@codecov
Copy link

codecov bot commented May 1, 2020

Codecov Report

Merging #2349 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2349   +/-   ##
=======================================
  Coverage   98.48%   98.48%           
=======================================
  Files          41       41           
  Lines        2305     2309    +4     
=======================================
+ Hits         2270     2274    +4     
  Misses         20       20           
  Partials       15       15           
Impacted Files Coverage Δ
context.go 98.08% <100.00%> (ø)
gin.go 99.15% <100.00%> (+0.01%) ⬆️
render/json.go 87.80% <100.00%> (ø)

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 05464a8...e7e1996. Read the comment docs.

@appleboy
Copy link
Member

appleboy commented May 5, 2020

conflicts

@bestgopher
Copy link
Contributor Author

conflicts

Where is the conflict?

@bestgopher
Copy link
Contributor Author

@appleboy fixed conflicts

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.

None yet

2 participants