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
go version
$ go version go version go1.17.2 darwin/amd64
Yes, also gotip.
https://play.golang.org/p/jSVnZBwYiwr
x := map[string]interface{}{ "field": "value", } data, err := json.MarshalIndent(x, "*** ", " ") if err != nil { log.Fatal(err) } fmt.Println(string(data))
*** { *** "field": "value" *** }
{ *** "field": "value" *** }
The text was updated successfully, but these errors were encountered:
Never mind. Looking at encoding_test.go it seems this is intentional to support indentation in source code. The description for MarshalIdent could be made clearer.
Sorry, something went wrong.
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, also gotip.
What did you do?
https://play.golang.org/p/jSVnZBwYiwr
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: