I agree json.MarshalIndent is great. However, be aware that
json.MarshalIndent will not output private (lowercase) fields of the struct.
On Monday, November 18, 2019 at 3:29:28 AM UTC-6, anderso...@blacklane.com
wrote:
>
> Hi Sankar,
>
> Not really, a easy trick is to use json.MarshalIndent. It
Hi Sankar,
Not really, a easy trick is to use json.MarshalIndent. It helped me a lot :)
playgound: https://play.golang.org/p/nfr2ANR6pPH
type A struct {
A int
B string
C map[int]string
}
func main() {
aa := A{
A: 1,
B: "2",
C: map[int]string{3: "3"},