田欧
df366c7840
chore: update go mod package ( #1792 )
2019-03-04 07:28:03 +08:00
田欧
8c8002d744
chore: add examples repo link to README ( #1788 )
2019-03-02 19:21:10 +08:00
田欧
0feaf8cbd8
Split examples to alone repo ( #1776 )
...
* split examples to alone repo
* vendor
* fix package error
* add examples/README.md
2019-03-01 23:42:41 +08:00
田欧
9bacadd3ea
remove docs dir ( #1786 )
...
the post doc move https://gin-gonic.com/blog/
2019-03-01 07:11:02 +08:00
田欧
d6adc8d0cc
chore: add go1.12 support ( #1780 )
...
* chore: add go1.12 support
* Update .travis.yml
2019-02-26 10:45:44 +08:00
田欧
e6886e1539
chore: fix Make script when failed ( #1774 )
2019-02-21 20:32:55 +08:00
田欧
d27685e714
chore: attempt to fix some gomod issue ( #1751 )
...
#1604 #1566 #1700 #1737
because some dependencies only are used on example i.e. grpc.
Or migrate `examples` to gin-gonic/examples`?
2019-01-26 02:28:39 +08:00
thinkerou
29a145c85d
Revert "context: inherits context cancelation and deadline from http.Request context for Go>=1.7 ( #1690 )" ( #1736 )
...
This reverts commit f67d7a90c4 .
2019-01-09 09:32:44 +08:00
thinkerou
0bfc9cbcdb
ci: exit 1 when build fail ( #1695 )
...
Like this:
```
FAIL github.com/gin-gonic/gin [build failed]
```
2018-12-26 00:27:46 +08:00
thinkerou
1b34e8e8de
chore: attemp to fix #1700 ( #1707 )
2018-12-25 23:40:11 +08:00
thinkerou
59695e7ba8
Add BindUri ( #1694 )
...
* add BindUri
* fix bug
* fix code style
2018-12-12 23:40:29 +08:00
thinkerou
cce49582d6
ci: break when test fail ( #1671 )
2018-12-05 13:49:03 +08:00
thinkerou
98c7ac7202
fix bug ( #1682 )
2018-12-05 13:36:49 +08:00
thinkerou
f463d847c2
chore: fix test fail ( #1669 )
...
* chore: fix test fail
* fix binduri test fail
2018-12-05 05:58:35 +08:00
thinkerou
54e9610400
chore: remove wercker yml file ( #1676 )
...
Now the `wercker.yml` have no longer used.
2018-12-05 02:02:03 +08:00
thinkerou
149ef75cdd
doc: remove README_ZH.md ( #1667 )
2018-11-26 21:05:54 +08:00
thinkerou
687d8b9ac6
add picfit to gin user list ( #1661 )
...
agreed with the project's author.
cc @thoas
thanks!
2018-11-25 20:52:46 +08:00
thinkerou
331af2219c
add krakend to gin user list ( #1658 )
2018-11-24 13:49:26 +01:00
thinkerou
521d06c81d
support bind uri param ( #1612 )
...
* 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
2018-11-22 09:29:48 +08:00
thinkerou
7ec82ee894
recovery: fix issue about syscall import on google app engine ( #1640 )
...
* recovery: fix issue about syscall import on google app engine
* add ToLower()
* the whole error message
2018-11-22 09:17:44 +08:00
田欧
a1a32562de
add gin user - photoprism ( #1601 )
2018-10-19 11:06:23 +08:00
田欧
524757b81c
vendor: upgrade some dependency package version ( #1596 )
...
ref https://github.com/gin-gonic/gin/pull/1569#issuecomment-429731722
2018-10-15 20:24:32 +08:00
田欧
98082fd590
document: add docs dir and middleware document ( #1521 )
...
* init docs dir
* add middleware document
* fix indent
* update docs
2018-10-15 13:01:44 +08:00
田欧
523435e524
attempt to support go module ( #1569 )
...
* support go module
* update golint package url
* update golint
2018-10-15 12:52:51 +08:00
田欧
b7314d943c
chore: fix debug test error ( #1574 )
2018-09-27 09:42:41 +08:00
田欧
834a2ec64c
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-09-26 13:49:11 +08:00
田欧
b02e4f2ed6
ci: fast finish when build failed ( #1568 )
2018-09-25 21:52:21 +08:00
田欧
5a75dc7127
add release badge for readme ( #1533 )
2018-09-22 11:37:28 +08:00
田欧
a210eea3bd
improve panic information when a catch-all wildcard conflict occurs ( #1529 )
2018-09-21 10:21:59 +08:00
田欧
f2cd3fcb2a
chore: fix typo and add a little anotation ( #1562 )
2018-09-20 11:53:58 +08:00
田欧
b27b7026c7
chore: add a version file includes gin version ( #1549 )
...
* chore: add a version file includes gin version
* update version for dev version
2018-09-17 15:08:11 +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
田欧
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
田欧
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
田欧
b7bb9baa64
chore: add missing copyright and update if/else ( #1497 )
2018-08-19 22:52:43 +08:00
田欧
32b58e0fd2
render: update msgpack usage ( #1498 )
...
please see msgpack usage: https://github.com/ugorji/go/tree/master/codec#usage
2018-08-19 22:14:02 +08:00
田欧
6073a79ee0
not use protobuf on context but use it on render ( #1496 )
2018-08-19 17:39:58 +08:00
田欧
bef6c56c89
chore: upgrade dependency library version ( #1491 )
...
upgrade lib version, and upgrade `github.com/json-iterator/go` to add two libs.
2018-08-16 17:38:17 +08:00
田欧
6c8a973134
add issue and pull request template explain ( #1483 )
...
* add issue/pr template explain
* add issue/pr template explain
2018-08-14 11:35:13 +08:00
田欧
f45c928a15
chore: use http.Status* instead of hard code ( #1482 )
2018-08-14 09:51:56 +08:00
田欧
6159213462
unify test data ( #1417 )
...
mkdir a test data dir.
2018-08-12 23:38:31 +08:00
田欧
1ae32f3a2c
improve render code coverage ( #1474 )
...
all code coverage > 99%
2018-08-12 22:02:37 +08:00
田欧
202db4fb11
improve utils code coverage ( #1473 )
2018-08-12 21:38:07 +08:00
田欧
e5bb4f62a2
chore: add return or remove else for reduce indent ( #1470 )
2018-08-12 21:17:57 +08:00
田欧
7e64d32269
Attempt to fix #1462 ( #1463 )
...
#1462
2018-08-12 10:12:33 +08:00
田欧
8fc8ce0472
small enhance for cleanPath ( #1469 )
...
from httprouter patch: https://github.com/julienschmidt/httprouter/pull/243
2018-08-10 20:50:23 +08:00
田欧
1f1bc429ed
chore: add test case for source/function of recovery.go ( #1467 )
2018-08-09 17:20:06 +08:00
田欧
9666ba6738
chore: update top bar header ( #1461 )
2018-08-07 13:49:31 +08:00
田欧
647535cd9b
Support map as query string or post form parameters ( #1383 )
...
* support query map
* add GetQueryMap and unittest
* support post-form map
* add readme for query map
* attempt to fix bug for post-form map when go version is 1.6
* remove duplicate code
* remove comment
2018-08-06 12:07:11 +08:00
田欧
1c4cbfae59
chore: remove duplicate code ( #1418 )
2018-07-02 11:06:56 +08:00
田欧
cdd02fa9d6
update error(err) to err ( #1416 )
...
the pull request update `return error(err)` to `return err`, and remove `kindOfData`.
2018-07-01 21:10:48 +08:00
田欧
eb9f313144
add comment for context ( #1413 )
...
ref #1075
annotation from go context source.
2018-06-28 17:08:09 +08:00
田欧
c00f21ff23
add go version prerequisite and debug warning ( #1394 )
...
* add go version prerequisite and debug warning
* merge duplicate content
* remove duplicate content
2018-06-26 18:56:43 +08:00
田欧
6c6d97ba2e
remove hardcode instead of http status value ( #1411 )
2018-06-26 17:21:32 +08:00
田欧
1f59bad84b
add an edge case from httprouter ( #1407 )
2018-06-23 11:06:27 +08:00
田欧
760d0574db
vendor: remove vendor package from example folder ( #1402 )
...
updated `vendor.json` is ok.
but set `ignore test` in `vendor.json`, `x/net/context` package only use in `context_test.go`, I don't know why vendor still need it.
please @appleboy review the pull request, thanks a lot.
2018-06-23 00:45:43 +08:00
田欧
8035359102
use strings.Split instead of strings.IndexByte ( #1406 )
2018-06-23 00:08:58 +08:00
田欧
605aa1c30f
example: fix typo for grpc ( #1405 )
...
sorry...fixed #1403
2018-06-22 23:44:45 +08:00
田欧
737d2fb7ab
add grpc example ( #1401 )
...
use grpc helloworld example.
2018-06-22 09:51:06 +08:00
田欧
87d536c001
utils: use strings.Split instead of strings.IndexByte ( #1400 )
...
And I test them benchmark:
code:
```go
# stringsbench.go
package stringsbench
import "strings"
func index(part string) string {
if index := strings.IndexByte(part, ';'); index >= 0 {
if part := strings.TrimSpace(strings.Split(part, ";")[0]); part != "" {
return part[0:index]
}
}
return ""
}
func split(part string) string {
return strings.Split(part, ";")[0]
}
```
```go
# stringsbench_test.go
package stringsbench
import (
"testing"
)
func BenchmarkIndex(b *testing.B) {
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
index("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8")
}
})
}
func BenchmarkSplit(b *testing.B) {
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
split("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8")
}
})
}
```
And the result:
```shell
➜ strings go test --bench=.
goos: darwin
goarch: amd64
BenchmarkIndex-8 30000000 46.1 ns/op
BenchmarkSplit-8 50000000 35.9 ns/op
PASS
ok _/Users/tianou/strings 3.271s
➜ strings go test --bench=.
goos: darwin
goarch: amd64
BenchmarkIndex-8 30000000 44.2 ns/op
BenchmarkSplit-8 50000000 34.7 ns/op
PASS
ok _/Users/tianou/strings 3.156s
➜ strings go test --bench=.
goos: darwin
goarch: amd64
BenchmarkIndex-8 30000000 45.6 ns/op
BenchmarkSplit-8 50000000 35.3 ns/op
PASS
ok _/Users/tianou/strings 3.230s
```
2018-06-21 09:31:43 +08:00
田欧
caf3e350a5
doc: update readme for adding binding about skip validate ( #1359 )
...
* update readme for adding binding about skip validate
* update readme for adding binding about skip validate
2018-05-31 14:13:40 +08:00
田欧
bd4f73af67
support struct pointer ( #1342 )
...
* support struct pointer
* add readme
2018-05-01 14:24:18 +08:00
田欧
41f951e0cd
support default value for form ( #1138 )
...
* support default value for form
* fix bug for nil interface
* use SplitN and optimization code
* add test case
* add test cases for form(own default value)
* fix invalid code
* fix code indent
* assert order
2018-04-25 16:24:03 +08:00
田欧
dfe37ea6f1
unify assert.Equal usage ( #1327 )
...
* unify assert.Equal usage
* fix typo
2018-04-20 10:27:44 +08:00
田欧
248c522e4a
Add Contents for README because it too long ( #1325 )
2018-04-20 09:54:00 +08:00
田欧
783c7ee9c1
Add some test cases and run test cases on binding/render dir ( #1168 )
...
* Travis run test cases on binding and render dir and add some test cases for binding and render
2018-01-26 11:46:11 +08:00
田欧
b70b8ab20c
use lower if the struct is private ( #1185 )
2017-12-17 13:02:33 +08:00
田欧
9e895470dd
add deprecated test case ( #1176 )
...
* add deprecated test case
* swap assert param
* remove
2017-11-29 16:42:51 +08:00
田欧
eeb57848ca
update assert param(expect, actual) position ( #1177 )
2017-11-21 21:18:45 +08:00
田欧
7e5aff8ea7
simple code and increase coverage ( #1174 )
2017-11-21 10:03:57 +08:00
田欧
1f377cb847
Add test cases for RunTLS and each mode ( #1173 )
...
* add RunTLS test cases and add debug/test mode cases
* add release mode cases
2017-11-21 09:27:57 +08:00
田欧
9a4ecc87d6
format some codes style ( #1165 )
2017-11-11 23:24:51 -06:00
田欧
9ae1e5db2a
add package for govendor ( #1166 )
...
* add package for govendor
* fix vet error.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com >
* add missing example.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com >
* update gin-gonic/autotls
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com >
2017-11-11 23:11:22 -06:00
田欧
6653d5d588
fix markdown render ( #1149 )
2017-10-29 21:38:38 -05:00
田欧
b7e8a6b9b0
style(import): not use aliase when import package ( #1146 )
2017-10-29 13:12:22 +01:00
田欧
1e88466d23
Update the comment of Version ( #1141 )
2017-10-25 21:25:25 -05:00
田欧
0cb7c44abc
Print warning log when user create one engine using gin.Default in debug mode ( #1121 )
...
* empty string check
* add log when use Default
* fix unit test error
* fix unit test error
2017-09-29 11:58:57 +08:00
田欧
3b300929e8
Empty string check ( #1101 )
2017-09-29 00:22:35 +08:00
田欧
f7376f7c7f
combine var and use tmp var ( #1108 )
2017-09-28 22:54:37 +08:00
田欧
b1ee49de8c
fix typo ( #1103 )
2017-09-08 08:56:56 +08:00
田欧
18b7c0892d
not use dot when import package ( #1077 )
2017-08-24 20:13:53 -05:00
田欧
c25254f563
reduce go cyclo ( #1076 )
...
* reduce go cyclo
* use := var
2017-08-24 20:00:49 -05:00
田欧
8be30bd382
Update readme for showing output log to file ( #1073 )
...
* Update readme for showing output log to file
* update indent
2017-08-22 13:55:32 +08:00
田欧
f4c9ac17a4
not display color when set disableColor ( #1072 )
2017-08-22 10:27:28 +08:00
田欧
a8fa424ae5
update comment ( #1057 )
2017-08-16 11:55:50 +08:00
田欧
52c2ed34b3
log format ( #1060 )
2017-08-14 14:34:29 +08:00
田欧
25d20a4463
merge args if it have same type ( #1059 )
2017-08-14 12:21:05 +08:00
田欧
d39ed41ab3
update template example ( #1038 )
...
* update template example
* add template example folder
2017-07-20 21:29:23 -05:00
田欧
7b508186dd
style: remove optional return ( #1036 )
2017-07-19 14:49:18 +02:00
田欧
7180f2ba62
not use tmp var ( #1032 )
2017-07-17 22:39:39 -05:00
田欧
199bbf2ae5
refactor(gin): use return not use else for reducing indent ( #1031 )
2017-07-17 20:11:53 -05:00
田欧
b539606eed
use return not use else ( #1028 )
2017-07-17 19:54:38 -05:00
田欧
bbd4dfee50
add warning using http2 example ( #1009 )
2017-07-12 02:01:46 -05:00
田欧
aa6d2d29f8
refactor(doc): use space not tab ( #1006 )
2017-07-11 10:28:08 -05:00
田欧
87fdff8f88
[docs] add http2 example ( #1000 )
2017-07-10 20:03:09 -05:00
田欧
44da058aa0
add favicon example ( #1001 )
2017-07-10 09:21:42 -05:00