Categorygithub.com/hgsgtk/jsoncmp
modulepackage
0.1.0
Repository: https://github.com/hgsgtk/jsoncmp.git
Documentation: pkg.go.dev

# README

JSON value comparison

Build Status Coverage Status GoDoc Go Report Card license

A Go JSON value comparison library for testing. It wraps github.com/google/go-cmp function. See the GoDoc documentation for more information.

Install

go get -u github.com/hgsgtk/jsoncmp

Usage

func TestDiff() {
	x := `
{
	"name": "Tom Bake",
	"age": 41
}`
	y := `
{
	"name": "Tom Bake",
	"age": 42
}
`
	var t stubT
	if diff := jsoncmp.Diff(x, y); diff != "" {
		t.Errorf("jsoncmp.Diff() got differs: (-got +want)\n%s", diff)
	}
}

License

MIT - See LICENSE file

# Functions

Diff returns a compared result of differences between two values.