Skip to content

Commit

Permalink
Merge pull request #503 from Jefftree/patch-experiment-json-test
Browse files Browse the repository at this point in the history
Patch go-json-experiment json to pass tests on go1.22
  • Loading branch information
k8s-ci-robot authored Aug 16, 2024
2 parents 91dab69 + 24eb939 commit 5732855
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ on:
branches: [ master ]
jobs:
ci:
strategy:
matrix:
go-version: [ '1.20', '1.21', '1.22', '1.23' ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
go-version: ${{ matrix.go-version }}
- name: Build
run: |
go mod tidy && git diff --exit-code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -1367,7 +1367,7 @@ func TestMarshal(t *testing.T) {
"Bytes": "",
"Int": 1,
"Uint": 1,
"Float": -0,
"Float": 5e-324,
"Map": {},
"StructScalars": {
"Bool": false,
Expand Down Expand Up @@ -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: `{
Expand Down Expand Up @@ -1616,7 +1616,7 @@ func TestMarshal(t *testing.T) {
"value"
],
"Pointer": {
"Float": -0
"Float": 5e-324
},
"Interface": [
""
Expand Down

0 comments on commit 5732855

Please sign in to comment.