Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add map to root of JSON? #74

Closed
AuroraTea opened this issue Sep 13, 2023 · 2 comments
Closed

How to add map to root of JSON? #74

AuroraTea opened this issue Sep 13, 2023 · 2 comments

Comments

@AuroraTea
Copy link

AuroraTea commented Sep 13, 2023

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?

@natenho
Copy link

natenho commented Oct 1, 2023

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

@AuroraTea
Copy link
Author

@natenho Thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants