1
0
mirror of https://github.com/json-iterator/go.git synced 2025-07-03 23:30:41 +02:00

feature #384: Specify custom map key sort function

This commit is contained in:
Zach McElrath
2019-07-09 15:57:36 -04:00
parent 27518f6661
commit 3e68b32b9a
5 changed files with 130 additions and 10 deletions

View File

@ -4,11 +4,10 @@ import (
"bytes"
"encoding/json"
"github.com/json-iterator/go"
"testing"
"github.com/stretchr/testify/require"
"testing"
)
type Foo struct {
Bar interface{}
}
@ -19,11 +18,10 @@ func (f Foo) MarshalJSON() ([]byte, error) {
return buf.Bytes(), err
}
// Standard Encoder has trailing newline.
func TestEncodeMarshalJSON(t *testing.T) {
foo := Foo {
foo := Foo{
Bar: 123,
}
should := require.New(t)