Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 871 Bytes

README.md

File metadata and controls

45 lines (31 loc) · 871 Bytes

Go Report Card Build Status codecov

ComapreJSON

Compare two json strings in go lang

Installation

go get github.com/orasik/gocomparejson

Usage

Example

package main

import (
	"fmt"
	jsonutil "github.com/orasik/gocomparejson"
)

func main() {
	json1 := []byte(`{"hello":"world"}`)
	json2 := []byte(`{
"hello":"world"
}`)

	val, err := jsonutil.CompareJSON(string(json1), string(json2))

	fmt.Print(val)
	fmt.Print(err)
}

Unit test

go test -v