(t *testing.T, got, want []byte)
| 103 | } |
| 104 | |
| 105 | func checkJSON(t *testing.T, got, want []byte) { |
| 106 | // compare the compact form, to allow for formatting differences |
| 107 | g := &bytes.Buffer{} |
| 108 | if err := json.Compact(g, []byte(got)); err != nil { |
| 109 | t.Fatal(err) |
| 110 | } |
| 111 | w := &bytes.Buffer{} |
| 112 | if err := json.Compact(w, []byte(want)); err != nil { |
| 113 | t.Fatal(err) |
| 114 | } |
| 115 | if g.String() != w.String() { |
| 116 | t.Errorf("encoded message does not match\nGot:\n%s\nWant:\n%s", g, w) |
| 117 | } |
| 118 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…