gin icon indicating copy to clipboard operation
gin copied to clipboard

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

Open bestgopher opened this issue 5 years ago • 4 comments

…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.

bestgopher avatar May 01 '20 10:05 bestgopher

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 98.48%. Comparing base (05464a8) to head (e7e1996). :warning: Report is 563 commits behind head on master.

Additional details and impacted files
@@           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           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar May 01 '20 10:05 codecov[bot]

conflicts

appleboy avatar May 05 '20 06:05 appleboy

conflicts

Where is the conflict?

bestgopher avatar May 05 '20 07:05 bestgopher

@appleboy fixed conflicts

bestgopher avatar May 05 '20 09:05 bestgopher