19 Commits

Author SHA1 Message Date
Pete Steyert-Woods
091584830b feat(codec/json): add opt-in encoding/json/v2 codec behind jsonv2 tag
As an experiment, with a thought for how Gin might eventually migrate to
and use features from jsonv2, I have put together a new json/codec for
json/v2.

---

Selected with -tags jsonv2, and constrained to go1.27 &&
goexperiment.jsonv2 since encoding/json/v2 is still gated by the
experiment in 1.27 and GOEXPERIMENT=nojsonv2 makes it unimportable.

json.go negates that entire expression, mirroring how it already
negates sonic's OS constraint, so -tags jsonv2 on Go 1.25/1.26 falls
back to encoding/json rather than leaving API nil.

Uses json.DefaultOptionsV1() to keep behaviour identical to the v1
codec: v2's native defaults would render nil slices/maps as []/{} and
match member names case-sensitively, silently zeroing fields that
previously bound.

Fills three v1 gaps v2's API doesn't cover directly: UseNumber has no
exported option, so it's reproduced with a custom *any unmarshaler;
MarshalWrite omits Encoder.Encode's trailing newline; MarshalIndent
becomes jsontext.WithIndentPrefix + WithIndent.
2026-09-01 14:41:31 +01:00
HolynnChen
cb2b764cc8
test(make): modify test folder and test command in Makefile (#4465)
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-02-28 21:55:28 +08:00
Mobin Mohanan
40131af124
ci(Makefile): added help and descriptions to targets (#3964) 2024-05-13 09:29:21 +08:00
imalasong
56dc72c4d5
ci(Makefile): vet command add .PHONY (#3915) 2024-04-02 11:58:00 +08:00
Rainshaw
8374ed2268
feat: add sonic json support (#3184)
* feat: add sonic json support

* fix: add blank line in readme
2022-08-02 10:20:59 +08:00
Jeff
fb8a113f8d
ci: add github action workflows (#2596)
* ci: add github action workflows

* test: fixed the TestUnixSocket test on windows (#20)

* ci: add github action workflows (#18)

* Remove .travis.yml

* ci: replace GITTER_ROOM_ID and upload coverage every time you go test

* ci: update coverage using codecov/codecov-action@v1

* Merge branch 'master' into github-actions

* repo: replace travis ci to github actions

* ci: add go version 1.16

* fix: go install requires a specific version

* chore(ci): remove go 1.12 support

* chore(ci): remove os windows-latest

Co-authored-by: thinkerou <thinkerou@gmail.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2021-06-23 13:10:49 +08:00
Antoine GIRARD
fd8a65b252 Add build tag nomsgpack (#1852)
* add build tag nomsgpack

* Update copyright

* Update copyright
2020-01-07 11:31:10 +08:00
thinkerou
3c8e29b53c
drop support govendor (#2148) 2019-11-25 15:42:23 +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
田欧
e6886e1539
chore: fix Make script when failed (#1774) 2019-02-21 20:32:55 +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
cce49582d6 ci: break when test fail (#1671) 2018-12-05 13:49:03 +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
Bo-Yi Wu
01ca2530d4 refactor(Makefile): allow overriding default go program (#1593) 2018-10-14 12:39:16 +08:00
Bo-Yi Wu
268e30710b
fix(Makefile): golint to new URL (#1592)
as title. Just update the golint to new URL.
2018-10-14 11:05:24 +08:00
田欧
737d2fb7ab add grpc example (#1401)
use grpc helloworld example.
2018-06-22 09:51:06 +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
Bo-Yi Wu
2fbb97117c
fix(build): remove unused target. (#1183) 2018-01-24 11:06:42 +08:00
Bo-Yi Wu
1e1e4fc867 Add Makefile to check the following thing (#947)
* Add Makefile to check the following thing.

* vet check
* fmt check
* embedmd check
* misspell check

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* remove unused variable.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-12 21:50:42 -05:00