Registry / utility / r3labs-diff

r3labs-diff

JSON →
library1.1.0gogounverified

A Go library for computing and applying diffs between arbitrary Go data structures.

go get github.com/r3labs/diff
INSTALL
IMPORT
SIG · R3LABS-DIFF
R
r3labs-diff
utilitygov1.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

diff
github.com/r3labs/diff

Computes the diff between two struct instances and prints the changes.

package main import ( "fmt" "github.com/r3labs/diff" ) func main() { type Person struct { Name string Age int } a := Person{Name: "Alice", Age: 30} b := Person{Name: "Bob", Age: 25} changes, err := diff.Diff(a, b) if err != nil { panic(err) } fmt.Printf("Changes: %+v\n", changes) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.1.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
r3labs-diff — go get r3labs-diff · libregistry