Set value type error!
xuzhuoxi opened this issue · comments
xuzhuoxi commented
sjson.Set(b.content, path, []uint8{1, 2, 3, 4})
value type "[]uint8" will change to "string"
Josh Baker commented
Go treats []byte
and []uint8
as the same thing, and sjson treats []byte
as a string
.
https://github.com/tidwall/sjson/blob/master/sjson.go#L674-L676
There's no way, that I know of, to make a distinction between []byte
and []uint8
.