From 6e4ee8db2d72aeccd0683a4027f169d054bbb809 Mon Sep 17 00:00:00 2001 From: Liz Kammer Date: Tue, 17 Aug 2021 17:32:42 -0400 Subject: [PATCH] Use pretty print for json module graph Test: SOONG_DUMP_JSON_MODULE_GRAPH=/tmp/json/srcs m nothing and verify output Change-Id: I779dcebce7435f2f48263909c4c62c27c0fbfec4 --- context.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/context.go b/context.go index cc6e8e1..3234fd7 100644 --- a/context.go +++ b/context.go @@ -2340,7 +2340,9 @@ func (c *Context) PrintJSONGraph(w io.Writer) { modules = append(modules, jm) } - json.NewEncoder(w).Encode(modules) + e := json.NewEncoder(w) + e.SetIndent("", "\t") + e.Encode(modules) } // PrepareBuildActions generates an internal representation of all the build