From 7d73591b59402369a8451073b4e382032e58dd00 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Aug 2025 16:01:56 +1000 Subject: [PATCH] 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] * 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] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Adrian Gallagher --- go.mod | 4 ++-- go.sum | 8 ++++---- types/time_test.go | 7 ++++++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 7802ba13..ab571211 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 1394d7ee..37af484f 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/types/time_test.go b/types/time_test.go index 554272da..ea018b6e 100644 --- a/types/time_test.go +++ b/types/time_test.go @@ -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())