yudai / gojsondiff

Go JSON Diff
Other
535 stars 81 forks source link

Two non-identical int64 numbers with 17 digits were compared, and the result obtained was the same. #48

Open miscomputer opened 1 year ago

miscomputer commented 1 year ago

func main() { json1 := { "custom_id":72211083386779239 } json2 := { "custom_id":72211083386779230 }

diff, _ := gojsondiff.New().Compare([]byte(json1), []byte(json2))

if diff.Modified() {
    fmt.Println(diff.Deltas())
} else {
    fmt.Println("Two JSONs are the same.")
}

}