* Add context.HandlerNames()
This change adds a HandlerNames method that will return all registered handles in the context, in descending order
This is useful for debugging and troubleshooting purposes, especially in large apps
* Tests
Add tests for HandlerNames
* Fix HandlerNames test
* Simplify test
Add a function `ForceConsoleColor`, like `DisableConsoleColor` but to force coloring the output.
It usefull when some IDE's integrated console (like IntelliJ or Goland) are not detected as TTY, but can display colors.
Also helps if one want to output color in log file (#1590) and as a workaround for #1547.
* fix Context.Next() - recheck len of handlers every iteration
* add tests when Context.reset() can be called inside of handler
TestEngineHandleContext
TestContextResetInHandler
TestRouterStaticFSFileNotFound
* Context.Next() - format to while style
*gin.Context implements standard context.Context methods, but always
returns data as context is still valid. Since Go 1.7, http.Request now
contains a context.Context object, which can be controlled by the
http.Server to indicates that the context is now closed, and persue of
request should be canceled.
This implements the propagation of http.Request context methods inside
gin.Context to have HTTP context cancelation information at gin.Context
level.
Signed-off-by: Romain Beuque <romain.beuque@corp.ovh.com>
* support bind uri (1)
* uri binding successful run
* fix vet warning: github.com/gin-gonic/gin/internal.Param composite literal uses unkeyed fields
* fix code style
* update function name
* fix test function signature
* add test for CanSet
* update readme and add test case
* remove internal.Params
* add coverage
* fix warning
Many debug logs have no line breaks, so fix them here.
- 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 integrations systems such as TravisCI.
- You should add/modify tests to cover your proposed code changes.
- If your pull request contains a new feature, please document it on the README.