equalAsJSON returns whether the values are equal when encoded as JSON.
(a, b interface{})
| 610 | |
| 611 | // equalAsJSON returns whether the values are equal when encoded as JSON. |
| 612 | func equalAsJSON(a, b interface{}) bool { |
| 613 | aj, err := json.Marshal(a) |
| 614 | if err != nil { |
| 615 | panic(err) |
| 616 | } |
| 617 | bj, err := json.Marshal(b) |
| 618 | if err != nil { |
| 619 | panic(err) |
| 620 | } |
| 621 | return bytes.Equal(aj, bj) |
| 622 | } |
no test coverage detected