Skip to content

About

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

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

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

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages