From 9382876c1ac1ee534674f5ae4d92e5f8d2c63f3d Mon Sep 17 00:00:00 2001 From: Jefftree Date: Fri, 16 Aug 2024 14:03:31 -0400 Subject: [PATCH] Patch https://github.com/go-json-experiment/json/commit/c2a874acdab3b26ac88290cff3b256169f420a48 so tests pass on later versions of go --- .../third_party/go-json-experiment/json/arshal_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/internal/third_party/go-json-experiment/json/arshal_test.go b/pkg/internal/third_party/go-json-experiment/json/arshal_test.go index 952d4d0f9..f2235c5ea 100644 --- a/pkg/internal/third_party/go-json-experiment/json/arshal_test.go +++ b/pkg/internal/third_party/go-json-experiment/json/arshal_test.go @@ -1351,7 +1351,7 @@ func TestMarshal(t *testing.T) { Bytes: []byte{}, // not omitted since allocated slice is non-zero Int: 1, // not omitted since 1 is non-zero Uint: 1, // not omitted since 1 is non-zero - Float: math.Copysign(0, -1), // not omitted since -0 is technically non-zero + Float: math.SmallestNonzeroFloat64, // not omitted since still slightly above zero Map: map[string]string{}, // not omitted since allocated map is non-zero StructScalars: structScalars{unexported: true}, // not omitted since unexported is non-zero StructSlices: structSlices{Ignored: true}, // not omitted since Ignored is non-zero @@ -1367,7 +1367,7 @@ func TestMarshal(t *testing.T) { "Bytes": "", "Int": 1, "Uint": 1, - "Float": -0, + "Float": 5e-324, "Map": {}, "StructScalars": { "Bool": false, @@ -1571,7 +1571,7 @@ func TestMarshal(t *testing.T) { PointerSlice: addr([]string{""}), PointerSliceEmpty: addr(sliceMarshalEmpty{"value"}), PointerSliceNonEmpty: addr(sliceMarshalNonEmpty{"value"}), - Pointer: &structOmitZeroEmptyAll{Float: math.Copysign(0, -1)}, + Pointer: &structOmitZeroEmptyAll{Float: math.SmallestNonzeroFloat64}, Interface: []string{""}, }, want: `{ @@ -1616,7 +1616,7 @@ func TestMarshal(t *testing.T) { "value" ], "Pointer": { - "Float": -0 + "Float": 5e-324 }, "Interface": [ ""