build(deps): Bump github.com/bytedance/sonic from 1.13.2 to 1.14.0 and fix test (#1984)

* build(deps): bump github.com/bytedance/sonic from 1.13.2 to 1.14.0

Bumps [github.com/bytedance/sonic](https://github.com/bytedance/sonic) from 1.13.2 to 1.14.0.
- [Release notes](https://github.com/bytedance/sonic/releases)
- [Commits](https://github.com/bytedance/sonic/compare/v1.13.2...v1.14.0)

---
updated-dependencies:
- dependency-name: github.com/bytedance/sonic
  dependency-version: 1.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* test: Enhance error handling in TestDateTimeUnmarshalJSON for unmarshal errors

* test: Make comparison string more specific since there's no exported type we can use

* test: Improve error handling in TestDateTimeUnmarshalJSON for sonic implementation

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
This commit is contained in:
dependabot[bot]
2025-08-15 16:01:56 +10:00
committed by GitHub
parent b0fa9c9881
commit 7d73591b59
3 changed files with 12 additions and 7 deletions

4
go.mod
View File

@@ -5,7 +5,7 @@ go 1.24.1
require (
github.com/Masterminds/sprig/v3 v3.3.0
github.com/buger/jsonparser v1.1.1
github.com/bytedance/sonic v1.13.2
github.com/bytedance/sonic v1.14.0
github.com/d5/tengo/v2 v2.17.0
github.com/gofrs/uuid v4.4.0+incompatible
github.com/gorilla/mux v1.8.1
@@ -39,7 +39,7 @@ require (
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.3.0 // indirect
github.com/boombuler/barcode v1.0.1 // indirect
github.com/bytedance/sonic/loader v0.2.4 // indirect
github.com/bytedance/sonic/loader v0.3.0 // indirect
github.com/cloudwego/base64x v0.1.5 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect

8
go.sum
View File

@@ -27,11 +27,11 @@ github.com/boombuler/barcode v1.0.1 h1:NDBbPmhS+EqABEs5Kg3n/5ZNjy73Pz7SIV+KCeqyX
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
github.com/bytedance/sonic v1.13.2 h1:8/H1FempDZqC4VqjptGo14QQlJx8VdZJegxs6wwfqpQ=
github.com/bytedance/sonic v1.13.2/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4=
github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=
github.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=
github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
github.com/bytedance/sonic/loader v0.2.4 h1:ZWCw4stuXUsn1/+zQDqeE7JKP+QO47tz7QCNan80NzY=
github.com/bytedance/sonic/loader v0.2.4/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=
github.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=
github.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=

View File

@@ -84,7 +84,12 @@ func TestDateTimeUnmarshalJSON(t *testing.T) {
jsonError *json.UnmarshalTypeError
parseError *time.ParseError
)
require.ErrorAs(t, json.Unmarshal([]byte(`69`), &testTime), &jsonError)
err := json.Unmarshal([]byte(`69`), &testTime)
if json.Implementation == "bytedance/sonic" {
require.ErrorContains(t, err, "Mismatch type string with value number", "Unmarshal must return the correct error text for sonic")
} else {
require.ErrorAs(t, err, &jsonError, "Unmarshal must return the correct error type for Go standard encoding/json")
}
require.ErrorAs(t, json.Unmarshal([]byte(`"2025"`), &testTime), &parseError)
require.NoError(t, json.Unmarshal([]byte(`"2018-08-20 19:20:46"`), &testTime))
assert.Equal(t, time.Date(2018, 8, 20, 19, 20, 46, 0, time.UTC), testTime.Time())