tidwall / sjson

Set JSON values very quickly in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug - Missing quotes?

Fenny opened this issue · comments

commented
var json = []byte(`{"message":""}`)
var path = "message"
var value = []byte("Hello, World!")
var opt = &sjson.Options{
  Optimistic: false,
}

raw, _ := sjson.SetRawBytesOptions(json, path, value, opt)
fmt.Println(string(json))
// => {"message":Hello, World!}
commented

After reading the source, raw is for raw input.
I thought it was designed for value strings only.