diff
diff copied to clipboard
A library for diffing golang structures
`patchLog.Applied()` is false when we run the following code snippet regardless the patch operation works as expected. ``` package main import ( "fmt" "github.com/r3labs/diff/v3" ) type Order struct { ID...
I'm getting some unexpected behaviour when diffing and applying the changelog for byte slices. In this example I am comparing 2 structs that have a byte slice and patching the...
👋🏻 hey there I'm using this library as it has been the most consistent way to compare structs that I've found so far, thanks! one feature that I'm missing is...
How do I force differ function so it would compare net.IP as a string and not as a slice? https://go.dev/play/p/0VMlM5RQ9WO ``` package main import ( "log" "net" "github.com/davecgh/go-spew/spew" "github.com/r3labs/diff/v2" )...
``` package main import ( "fmt" "github.com/r3labs/diff/v2" ) type Data struct { ID int32 `json:"id" diff:"ID"` Value string `json:"value" diff:"Value"` } type Order struct { Items []Data `diff:"Items,ID"` } func...
I am trying to compare slice of maps but the results are inconsistent. As I understand correctly the code below should show the same result for a == b and...
unsupported type: array when ID withh uuid.UUID
Will there be a support for the type primitive.ObjectID for MongoDB? Or is there a way to add types ourselves? https://pkg.go.dev/go.mongodb.org/mongo-driver Right now I have to deactivate all of them...
I'm having issues when I have a struct that contains a pointer to an array of string. An example of this problem ```golang package main import ( "github.com/r3labs/diff/v2" ) type...
We want to compare slices of strings. Following example code: ``` type TestStruct struct { Slice []string `json:"slice"` } type TestData struct { TS *TestStruct } func main() { s1...