Skip to content

Compare two json strings in golang and return true if they match

License

Notifications You must be signed in to change notification settings

orasik/gocomparejson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Compare two json strings in golang and return true if they match

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages