You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,13 @@ A library for diffing golang structures and values.
4
4
5
5
Utilizing field tags and reflection, it is able to compare two structures of the same type and create a changelog of all modified values. The produced changelog can easily be serialized to json.
6
6
7
-
NOTE: All active development now takes place on the v2 branch.
7
+
NOTE: All active development now takes place on the v3 branch.
8
8
9
9
## Installation
10
10
11
-
For version 2:
11
+
For version 3:
12
12
```
13
-
go get github.com/r3labs/diff/v2
13
+
go get github.com/r3labs/diff/v3
14
14
```
15
15
16
16
## Changelog Format
@@ -84,7 +84,7 @@ In order for struct fields to be compared, they must be tagged with a given name
84
84
Diffing a basic set of values can be accomplished using the diff functions. Any items that specify a "diff" tag using a name will be compared.
85
85
86
86
```go
87
-
import"github.com/r3labs/diff/v2"
87
+
import"github.com/r3labs/diff/v3"
88
88
89
89
typeOrderstruct {
90
90
IDstring`diff:"id"`
@@ -125,7 +125,7 @@ When marshalling the changelog to json, the output will look like:
125
125
126
126
Options can be set on the differ at call time which effect how diff acts when building the change log.
127
127
```go
128
-
import"github.com/r3labs/diff/v2"
128
+
import"github.com/r3labs/diff/v3"
129
129
130
130
typeOrderstruct {
131
131
IDstring`diff:"id"`
@@ -151,7 +151,7 @@ func main() {
151
151
You can also create a new instance of a differ that allows options to be set.
152
152
153
153
```go
154
-
import"github.com/r3labs/diff/v2"
154
+
import"github.com/r3labs/diff/v3"
155
155
156
156
typeOrderstruct {
157
157
IDstring`diff:"id"`
@@ -205,7 +205,7 @@ To accommodate this patch keeps track of each change log option it attempts to a
205
205
happened for further scrutiny.
206
206
207
207
```go
208
-
import"github.com/r3labs/diff/v2"
208
+
import"github.com/r3labs/diff/v3"
209
209
210
210
typeOrderstruct {
211
211
IDstring`diff:"id"`
@@ -239,7 +239,7 @@ Instances of differ with options set can also be used when patching.
239
239
```go
240
240
package main
241
241
242
-
import"github.com/r3labs/diff/v2"
242
+
import"github.com/r3labs/diff/v3"
243
243
244
244
typeOrderstruct {
245
245
IDstring`json:"id"`
@@ -271,7 +271,7 @@ As a convenience, there is a Merge function that allows one to take three interf
0 commit comments