diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2026-10-12 23:41:10 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2026-10-12 23:41:10 +0200 |
| commit | 793e1705b4c34405f24d0f95ab532b68e8db673a (patch) | |
| tree | 45e3f64777ad3aa64aa3f1beec8d2b0ee39e737a /jsonmatch/diff_test.go | |
| parent | 8f6f95650d876376664f1e5a04d9c4cf369468d8 (diff) | |
| download | go-gg-793e1705b4c34405f24d0f95ab532b68e8db673a.tar.gz | |
replace all json.Marshaler{ => To} and json.Unmarshaler{ => From}
Diffstat (limited to 'jsonmatch/diff_test.go')
| -rw-r--r-- | jsonmatch/diff_test.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/jsonmatch/diff_test.go b/jsonmatch/diff_test.go index d81c54b..1d89f94 100644 --- a/jsonmatch/diff_test.go +++ b/jsonmatch/diff_test.go @@ -4,7 +4,8 @@ package jsonmatch_test import ( - "encoding/json" + "encoding/json/jsontext" + "encoding/json/v2" "errors" "fmt" "strings" @@ -24,8 +25,8 @@ var ( _ jsonmatch.Diffable = jsonmatch.Scalar("foo") _ jsonmatch.Diffable = jsonmatch.Scalar(42) _ jsonmatch.Diffable = jsonmatch.Scalar(false) - _ = jsonmatch.CaptureField(Some(1).AsPointer()).(json.Marshaler) - _ = jsonmatch.CaptureField(Some(1).AsPointer()).(json.Unmarshaler) + _ = jsonmatch.CaptureField(Some(1).AsPointer()).(json.MarshalerTo) + _ = jsonmatch.CaptureField(Some(1).AsPointer()).(json.UnmarshalerFrom) ) func TestCanonicalizesActualPayload(t *testing.T) { @@ -389,8 +390,8 @@ func TestFailsOnUnmarshalError(t *testing.T) { type unmarshalableObject struct{} -func (unmarshalableObject) MarshalJSON() ([]byte, error) { - return nil, errors.New("this object is unmarshalable") +func (unmarshalableObject) MarshalJSONTo(enc *jsontext.Encoder) error { + return errors.New("this object is unmarshalable") } func TestArrayOnArrayAction(t *testing.T) { |
