MustUnmarshalJSON marshalls the given interface into JSON. If there is any error, it fails the test.
(t *testing.T, data []byte, v interface{})
| 284 | // MustUnmarshalJSON marshalls the given interface into JSON. |
| 285 | // If there is any error, it fails the test. |
| 286 | func MustUnmarshalJSON(t *testing.T, data []byte, v interface{}) { |
| 287 | err := json.Unmarshal(data, v) |
| 288 | if err != nil { |
| 289 | t.Fatalf("%s: unmarshalling data: %s", t.Name(), err.Error()) |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | // MustGenerateUUID generates the uuid. If error occurs, it fails the test. |
| 294 | func MustGenerateUUID(t *testing.T) string { |