From 7457c80f77c486015fb7469ffe79271cce02c2ee Mon Sep 17 00:00:00 2001 From: Valentin Kuznetsov Date: Fri, 8 Dec 2023 09:15:32 -0500 Subject: [PATCH] Use MarshalIndent --- mongotools/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mongotools/main.go b/mongotools/main.go index 7fb55be..5067416 100644 --- a/mongotools/main.go +++ b/mongotools/main.go @@ -85,7 +85,7 @@ func exportData(client *mongo.Client, dbname, collname, fname string) { } cur.All(ctx, &records) log.Printf("found %d records\n", len(records)) - data, err := json.Marshal(records) + data, err := json.MarshalIndent(records, "", " ") if err != nil { log.Fatal(err) }