tidwall / sjson

Set JSON values very quickly in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to add map to root of JSON?

AuroraTea opened this issue · comments

origin := {"a":"a"}
new, err := sjson.Set(origin, "", map[string]any{
	"b": "b",
})

Expect: {"a":"a","b":"b"}
but give me an error path cannot be empty

What is the correct way to write it?

@AuroraTea you may take a look at #69, it is the same use case.

@natenho Thanks!!!