1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-24 23:16:47 +02:00

move IndentionStep to config

This commit is contained in:
Tao Wen
2017-06-13 17:03:27 +08:00
parent acddcf5bbf
commit 48e9f6ec84
6 changed files with 20 additions and 16 deletions

View File

@ -210,8 +210,9 @@ func Test_object_wrapper_any_get_all(t *testing.T) {
func Test_write_object(t *testing.T) {
should := require.New(t)
buf := &bytes.Buffer{}
stream := NewStream(DEFAULT_CONFIG, buf, 4096)
stream.IndentionStep = 2
newCfg := &Config{IndentionStep: 2}
initConfig(newCfg)
stream := NewStream(newCfg, buf, 4096)
stream.WriteObjectStart()
stream.WriteObjectField("hello")
stream.WriteInt(1)