Skip to content

Commit

Permalink
调整json配置
Browse files Browse the repository at this point in the history
  • Loading branch information
steden committed Dec 5, 2024
1 parent 0c6ea74 commit 704e79d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions snc/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ func init() {
option.DefaultAstBufferSize = 2 * 1024

snc = sonic.Config{
CompactMarshaler: true,
UseNumber: true,
CopyString: true,
CompactMarshaler: true, // 输出紧凑json
NoNullSliceOrMap: true, // 空对象编码为:[] {}
UseInt64: true, // 整数对象转换为int64,否则为float64
UseNumber: true, // 不要转换成float64而是json.number
CopyString: true, // 不要引用字符串,而是复制一份出来
}.Froze()
}

Expand Down

0 comments on commit 704e79d

Please sign in to comment.