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

#53 split config into Config and frozenConfig

This commit is contained in:
Tao Wen
2017-06-13 18:49:35 +08:00
parent d0418857ce
commit d867c8ba5c
11 changed files with 61 additions and 65 deletions

View File

@ -172,7 +172,7 @@ func (decoder *AdaptedDecoder) UseNumber() {
}
func NewEncoder(writer io.Writer) *AdaptedEncoder {
stream := NewStream(&Config{}, writer, 512)
stream := NewStream(Config{}.Froze(), writer, 512)
return &AdaptedEncoder{stream}
}
@ -187,5 +187,5 @@ func (adapter *AdaptedEncoder) Encode(val interface{}) error {
}
func (adapter *AdaptedEncoder) SetIndent(prefix, indent string) {
adapter.stream.cfg.IndentionStep = len(indent)
adapter.stream.cfg.indentionStep = len(indent)
}