jsoniter_interface_test.go 276 B

1234567891011121314
  1. package jsoniter
  2. import (
  3. "testing"
  4. "github.com/json-iterator/go/require"
  5. )
  6. func Test_write_array_of_interface(t *testing.T) {
  7. should := require.New(t)
  8. array := []interface{}{"hello"}
  9. str, err := MarshalToString(array)
  10. should.Nil(err)
  11. should.Equal(`["hello"]`, str)
  12. }