logoalt Hacker News

athorax • yesterday at 6:59 PM • 1 reply • view on HN

I'm not sure if I'm missing something, but isn't this functionality just moved into jsontext? https://pkg.go.dev/encoding/json/jsontext#Value.Indent

  v := jsontext.Value(b)
  v.Indent()
  fmt.Println(string(v))

Replies

irq-1 • yesterday at 8:22 PM

    func WithIndent(indent string) Options
https://pkg.go.dev/encoding/json/jsontext#WithIndent