Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch go-json-experiment json to pass tests on go1.22 #503

Merged
merged 2 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading