jsondiff

package module
v0.0.0-...-d4c531e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2019 License: MIT Imports: 4 Imported by: 0

README

Json Diff

Go Report Card

Gopher image

Just a simple library to compare two JSON objects represented in Go map data type. Returns an array of strings with the key values that differ.

Documentation

Overview

Package jsondiff provides comparing for json maps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diff

func Diff(firstJson map[string]interface{}, secondJson map[string]interface{}) []string

Diff compare two jsons map and returns the fields names that has been changed. If input maps are equal, all return values will be empty.

func DiffWithValues

func DiffWithValues(firstJson map[string]interface{}, secondJson map[string]interface{}) (diff []string, firstValues map[string]interface{}, secondValues map[string]interface{})

DiffWithValues compare two jsons map and returns the fields names and values that has been changed. If input maps are equal, all return values will be empty. Otherwise diff slice will contain the field names list, those field names will also be present in FirstValues and SecondValues combined with their respective values from firstJson and secondJson.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL