We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c9fdfb commit eac0f29Copy full SHA for eac0f29
writer/json.go
@@ -4,6 +4,7 @@ import (
4
"encoding/json"
5
"fmt"
6
"io"
7
+ "os"
8
9
"github.com/dineshba/tf-summarize/terraformstate"
10
"github.com/dineshba/tf-summarize/tree"
@@ -40,7 +41,11 @@ func treeValue(t tree.Tree) interface{} {
40
41
after, _ := json.Marshal(t.Value.Change.After)
42
_, str := jsondiff.Compare(before, after, &opts)
43
diff = make(map[string]interface{})
- _ = json.Unmarshal([]byte(str), &diff)
44
+ err := json.Unmarshal([]byte(str), &diff)
45
+ if err != nil {
46
+ fmt.Fprintf(os.Stderr, "warning: unmarshalling diff error: %s\n", err)
47
+ diff = fmt.Sprintf("raw diff: %s", str)
48
+ }
49
} else {
50
if t.IsAddition() || t.IsImport() {
51
diff = t.Value.Change.After
0 commit comments