Skip to content

Commit

Permalink
Use MarshalIndent
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Dec 8, 2023
1 parent a9fbc71 commit 7457c80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mongotools/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 7457c80

Please sign in to comment.