Categorygithub.com/nsf/jsondiff
modulepackage
0.0.0-20230430225905-43f6cf3098c1
Repository: https://github.com/nsf/jsondiff.git
Documentation: pkg.go.dev

# README

JsonDiff library

The main purpose of the library is integration into tests which use json and providing human-readable output of test results.

The lib can compare two json items and return a detailed report of the comparison.

At the moment it can detect a couple of types of differences:

  • FullMatch - means items are identical.
  • SupersetMatch - means first item is a superset of a second item.
  • NoMatch - means objects are different.

Being a superset means that every object and array which don't match completely in a second item must be a subset of a first item. For example:

{"a": 1, "b": 2, "c": 3}

Is a superset of (or second item is a subset of a first one):

{"a": 1, "c": 3}

Library API documentation can be found on godoc.org: https://godoc.org/github.com/nsf/jsondiff

You can try LIVE version here (compiled to wasm): https://nosmileface.dev/jsondiff

The library is inspired by http://tlrobinson.net/projects/javascript-fun/jsondiff/

# Functions

Compare compares two JSON documents using given options.
CompareStreams compares two JSON documents streamed by the specified readers.
Provides a set of options that are well suited for console output.
Provides a set of options that are well suited for HTML output.
Provides a set of options in JSON format that are fully parseable.
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author