1159 Commits

Author SHA1 Message Date
Justin Israel
a3804b6291 Only build recovery tests for go >=1.7 2018-11-04 11:56:47 +13:00
chenyang929
17b319b019 Update README.md (#1620)
Missing the right colon
2018-11-04 11:56:11 +13:00
Barnabus
7f6ddf2fb2 Change HTML link tags to use HTML5 syntax. (#1621)
The `<link>` element is an empty element, it contains attributes only. In HTML5 the `<link>` tag has no end tag. In XHTML the `<link>` tag must be properly closed.
2018-11-04 11:56:11 +13:00
Barnabus
6c0566e2b8 Change HTML input tags to use HTML5 syntax. (#1617)
In XHTML, the <input> tag must be properly closed, like this `<input />`.  In HTML5 the `<input>` tag has no ending slash.  https://www.w3schools.com/tags/tag_input.asp
2018-11-04 11:56:11 +13:00
root@andrea:~#
58e2fbc264 Added some comments to avoid having golint warnings (#1619)
The following comments to vars, conts and method were added to pass  `golinter` with 100%.

![captura de pantalla 2018-10-31 a la s 15 23 37](https://user-images.githubusercontent.com/10160626/47819725-faba3780-dd20-11e8-978c-1b3ab7de26ed.png)
2018-11-04 11:56:11 +13:00
forging2012
49409835fb FIX r.LoadHTMLGlob("/path/to/templates") (#1616)
FIX r.LoadHTMLGlob("/path/to/templates")) to r.LoadHTMLGlob("/path/to/templates")
2018-11-04 11:56:11 +13:00
Thomas Schaffer
c03447e347 Expose HandlerFunc in RouteInfos (#1272) 2018-11-04 11:56:11 +13:00
Ismail Gjevori
940d1f53f0 Pass MaxMultipartMemory when FormFile is called (#1600)
When `gin.Context.FormFile("...")` is called the `engine.MaxMultipartMemory` is never used. This PR makes sure that the `MaxMultipartMemory` is passed and removes 2 calls to `http.Request.ParseForm` since they are called from `http.Request.ParseMultipartForm`
2018-11-04 11:56:11 +13:00
田欧
64ea6f1b9d add gin user - photoprism (#1601) 2018-11-04 11:56:11 +13:00
A. F
de4743e797 add example to set and get cookies (#1599) 2018-11-04 11:56:11 +13:00
Sergey Ponomarev
a5395d57f8 Fix LoadHTML* tests (#1559)
Digging into the test code base I've found out that some of the tests for `LoadHTML*` methods are not reliable and efficient. They use timeouts to be sure that goroutine with the server has started. And even more, in old implementation, the server started only once – all the new instances silently failed due to the occupied network port.

Here is a short overview of the proposed changes: 
- it's not necessary to rely on timeouts, the server starts listening synchronously and returns control when it is ready
- once the server is run, it's stopped after a test passes
- dry out http server setup
- magic with empty closure return is eliminated 
- preserve router.RunTLS coverage with integration tests
2018-11-04 11:56:11 +13:00
田欧
37c19a7af8 vendor: upgrade some dependency package version (#1596)
ref https://github.com/gin-gonic/gin/pull/1569#issuecomment-429731722
2018-11-04 11:56:11 +13:00
田欧
d369746664 document: add docs dir and middleware document (#1521)
* init docs dir

* add middleware document

* fix indent

* update docs
2018-11-04 11:56:11 +13:00
田欧
e3a3b89f97 attempt to support go module (#1569)
* support go module

* update golint package url

* update golint
2018-11-04 11:56:11 +13:00
Bo-Yi Wu
2bcc84ab3c refactor(Makefile): allow overriding default go program (#1593) 2018-11-04 11:56:11 +13:00
Bo-Yi Wu
cd693b4dcc fix(Makefile): golint to new URL (#1592)
as title. Just update the golint to new URL.
2018-11-04 11:56:11 +13:00
andriikushch
bf400765a2 replace deprecated HeaderMap with Header() (#1585) 2018-11-04 11:56:11 +13:00
zesani
9a0fc0f2b9 Update README.md (#1583)
change "hava" to "have"
2018-11-04 11:56:11 +13:00
James Pettyjohn
5cc05e9119 removed use of sync.pool from HandleContext and added test coverage (#1565)
As per #1230 there is an issue when using HandleContext where the context of the request is returned to the context sync.Pool before the parent request has finished, causing context to be used in a non-thread safe manner.

I've removed the bug by not entering the context back in the pool and leaving that to ServeHTTP.

There was no test coverage for this function so I've also added the test to cover it. As the bug only happens when there are concurrent requests, the tests issues hundreds of concurrent requests. Without the bug fixed the tests do consistently recreate the error.
2018-11-04 11:56:11 +13:00
Bo-Yi Wu
e4e4270e14 remove allow fail flag (#1573)
golang team revert the net/url issue: https://github.com/golang/go/issues/27302
2018-11-04 11:56:11 +13:00
田欧
1ded27a2b4 chore: fix debug test error (#1574) 2018-11-04 11:56:11 +13:00
Bo-Yi Wu
331ad88c90 fix: fmt output log to os.Stderr (#1571)
fix #1560 changes are breaking in App Engine.

cc @giulianobr @philippgille
2018-11-04 11:56:11 +13:00
田欧
d1b243dfb0 feat: add go version judge when print debug warning log (#1572)
* feat: add go version judge when print debug warning log

* remove invalid statement

* use one const
2018-11-04 11:56:11 +13:00
andrea
425f80bae4 Make logger use a yellow background and a darkgray text for legibility (#1570)
1. Why is this change neccesary?
White text on a yellow background was illegible with most terminal color schemes

2. How does it address the issue?
The white text was replaced with a bash compatible dark gray while keeping the
yellow background colour

3. What side effects does this change have?
Resolves #1552
2018-11-04 11:56:11 +13:00
田欧
946eba9862 ci: fast finish when build failed (#1568) 2018-11-04 11:56:11 +13:00
Dustin Decker
5548cc3c53 Don't log requests (#1370)
Fixes #1331

HTTP logging leaks sensitive request information.

This PR removes HTTP request logging during panics.
2018-11-04 11:56:11 +13:00
田欧
1e326a1bb7 add release badge for readme (#1533) 2018-11-04 11:20:22 +13:00
田欧
d02ae1eb1a improve panic information when a catch-all wildcard conflict occurs (#1529) 2018-11-04 11:20:22 +13:00
田欧
500ad23339 chore: fix typo and add a little anotation (#1562) 2018-11-04 11:20:22 +13:00
Javier Provecho Fernandez
8a7ccc35cc chore: recover go master build, partial revert #1514 (#1561)
* chore: recover go master build, partial revert #1514

* chore: add master to go branch build targets
2018-11-04 11:20:22 +13:00
Bo-Yi Wu
10ba502ec0 feat: replace debug log with fmt package. (#1560) 2018-11-04 11:20:22 +13:00
田欧
076e18224c chore: add a version file includes gin version (#1549)
* chore: add a version file includes gin version

* update version for dev version
2018-11-04 11:20:22 +13:00
Justin Israel
d3a05e47f2 gofmt recovery changes (refs #1259) 2018-09-17 17:10:30 +12:00
Justin Israel
97c4c98a45
Fix stack function not being called with params (merge conflict) (refs #1259) 2018-09-17 17:04:55 +12:00
Justin Israel
e7078e9dc0
Merge branch 'master' into 1089_broken_pipe 2018-09-17 16:46:19 +12:00
Jérôme Laforge
90c680ef5c Let's user define how he wants to log his routes (eg. JSON, key value, or something else) (#1553) (#1555) 2018-09-17 12:09:34 +08:00
田欧
7c7f703cc5
initial go.mod module definition (#1554) 2018-09-16 23:22:54 +08:00
田欧
6db092f778 chore: add some annotations (#1550)
ref #1075 should all annotations and can close #1075 .
2018-09-15 15:21:54 +08:00
田欧
d510595aa5 chore: add some annotations (#1544)
ref: #1075 
because I am not a native English, maybe have a bit problem.
2018-09-15 10:23:32 +08:00
Iskander (Alex) Sharipov
3f27866f80 simplify slice expressions: s[:] => s (#1541)
Found using https://go-critic.github.io/overview#unslice-ref
2018-09-12 21:21:26 +08:00
Iskander (Alex) Sharipov
df1e17c2f0 remove debug print statements from test code (#1540)
Found using https://go-critic.github.io/overview#commentedOutCode-ref
2018-09-12 09:13:16 +08:00
Javier Provecho Fernandez
500ebd9ea8
docs: add fnproject to gin's user list (#1505) 2018-08-31 22:38:16 +02:00
田欧
705e199298 chore: update issue_implate (#1524) 2018-09-01 00:40:33 +08:00
田欧
7451a402bb chore: update vendor version (#1520)
#1491 adds some lib when upgrade json-iterator but it is not needed, and use `v1.1.5` not `1.1.5` version for json-iterator.
2018-08-30 23:36:53 +08:00
田欧
72db8acd99
add internal package which includes json package (#1504) 2018-08-30 19:04:03 +08:00
llgoer
708b76adf0 Update README.md (#1509)
change  `ShouldBindXML` to `ShouldBindJSON`
2018-08-30 14:29:26 +08:00
Bo-Yi Wu
09d342abbc Add golang 1.11.x testing (#1514)
* Add golang 1.11.x testing

* remove the latest golang testing

See the issue: https://github.com/gin-gonic/gin/pull/1510
2018-08-30 14:22:51 +08:00
anoty
0da5b0c85a format readme code import (#1503) 2018-08-21 13:29:25 +08:00
田欧
85f3e78abc chore: remove else instead of return/continue (#1502)
As[ Effective Go](https://golang.org/doc/effective_go.html?#if) about `if` said, remove else statement instead of return/continue statement.
2018-08-20 21:49:24 +08:00
junfengye
0ebd42d0a9 Update jsoniter.go (#1500)
add newencoder to fix compile error for -tags=jsoniter
2018-08-20 18:25:45 +08:00