File tree Expand file tree Collapse file tree 2 files changed +0
-26
lines changed
Expand file tree Collapse file tree 2 files changed +0
-26
lines changed Original file line number Diff line number Diff line change @@ -104,21 +104,10 @@ type JSONMetadata struct {
104104}
105105
106106var (
107- // Ensure JSONMetadata implements the json.Marshaler interface
108- _ json.Marshaler = & JSONMetadata {}
109107 // Ensure JSONMetadata implements the json.Unmarshaler interface
110108 _ json.Unmarshaler = & JSONMetadata {}
111109)
112110
113- // MarshalJSON returns a json representation of the wrapped Metadata
114- func (j JSONMetadata ) MarshalJSON () ([]byte , error ) {
115- if j .Metadata == nil {
116- j .Metadata = New ()
117- }
118-
119- return json .Marshal (j .Metadata )
120- }
121-
122111// UnmarshalJSON unmarshal the json into Metdadata
123112func (j * JSONMetadata ) UnmarshalJSON (data []byte ) error {
124113 r := jlexer.Lexer {Data : data }
Original file line number Diff line number Diff line change @@ -212,21 +212,6 @@ func TestMetadata_MarshalJSON(t *testing.T) {
212212 }
213213}
214214
215- func TestJSONMetadata_MarshalJSON (t * testing.T ) {
216- for _ , testCase := range jsonTestCases {
217- t .Run (testCase .title , func (t * testing.T ) {
218- m := metadata.JSONMetadata {
219- Metadata : testCase .metadata (),
220- }
221-
222- mJSON , err := json .Marshal (m )
223-
224- assert .JSONEq (t , testCase .json , string (mJSON ))
225- assert .NoError (t , err )
226- })
227- }
228- }
229-
230215func TestJSONMetadata_UnmarshalJSON (t * testing.T ) {
231216 for _ , testCase := range jsonTestCases {
232217 t .Run (testCase .title , func (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments