🐛 WriteValue can handle slices and maps
This commit is contained in:
parent
820a2de269
commit
59634f6c3f
2 changed files with 14 additions and 0 deletions
|
|
@ -30,6 +30,8 @@ func TestWriteBuffer(t *testing.T) {
|
|||
{"json.Number", json.Number("42.13"), "42.13", nil},
|
||||
{"json.RawMessage", json.RawMessage("{}"), "{}", nil},
|
||||
{"time", when, when.Format(time.RFC3339), nil},
|
||||
{"slice", []any{1, 2, "foo"}, `[1,2,"foo"]`, nil},
|
||||
{"map", map[string]any{"baz": 42, "foo": "bar"}, `{"baz":42,"foo":"bar"}`, nil},
|
||||
{"struct", struct{}{}, "", errors.New("Unsupported type struct {}")},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue