Skip to content

Commit 3d2b8dd

Browse files
committed
go fmt
1 parent 7fc9952 commit 3d2b8dd

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

diff/dmp.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ func (p *Patch) String() string {
125125
if p.length1 == 0 {
126126
coords1 = strconv.Itoa(p.start1) + ",0"
127127
} else if p.length1 == 1 {
128-
coords1 = strconv.Itoa(p.start1+1)
128+
coords1 = strconv.Itoa(p.start1 + 1)
129129
} else {
130130
coords1 = strconv.Itoa(p.start1+1) + "," + strconv.Itoa(p.length1)
131131
}
132132

133133
if p.length2 == 0 {
134134
coords2 = strconv.Itoa(p.start2) + ",0"
135135
} else if p.length2 == 1 {
136-
coords2 = strconv.Itoa(p.start2+1)
136+
coords2 = strconv.Itoa(p.start2 + 1)
137137
} else {
138138
coords2 = strconv.Itoa(p.start2+1) + "," + strconv.Itoa(p.length2)
139139
}
@@ -199,7 +199,7 @@ func New() *DiffMatchPatch {
199199
func (dmp *DiffMatchPatch) DiffMain(text1, text2 string, checklines bool) []Diff {
200200
var deadline time.Time
201201
if dmp.DiffTimeout <= 0 {
202-
deadline = time.Now().Add(24*365*time.Hour)
202+
deadline = time.Now().Add(24 * 365 * time.Hour)
203203
} else {
204204
deadline = time.Now().Add(dmp.DiffTimeout)
205205
}
@@ -484,7 +484,7 @@ func (dmp *DiffMatchPatch) DiffBisect(text1, text2 string, deadline time.Time) [
484484
}
485485

486486
func (dmp *DiffMatchPatch) diffBisectSplit_(text1, text2 string, x, y int,
487-
deadline time.Time) []Diff {
487+
deadline time.Time) []Diff {
488488
text1a := text1[:x]
489489
text2a := text2[:y]
490490
text1b := text1[x:]
@@ -2101,4 +2101,3 @@ func (dmp *DiffMatchPatch) PatchFromText(textline string) ([]Patch, error) {
21012101
}
21022102
return patches, nil
21032103
}
2104-

diff/dmp_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ func Test_diffMain(t *testing.T) {
901901
// Test that we didn't take forever (be forgiving).
902902
// Theoretically this test could fail very occasionally if the
903903
// OS task swaps or locks up for a second at the wrong moment.
904-
assert.True(t, delta < (dmp.DiffTimeout * 2), fmt.Sprintf("%v !< %v", delta, dmp.DiffTimeout*2))
904+
assert.True(t, delta < (dmp.DiffTimeout*2), fmt.Sprintf("%v !< %v", delta, dmp.DiffTimeout*2))
905905
dmp.DiffTimeout = 0
906906

907907
// Test the linemode speedup.
@@ -1304,6 +1304,5 @@ func Benchmark_DiffMain(bench *testing.B) {
13041304

13051305
for i := 0; i < bench.N; i++ {
13061306
dmp.DiffMain(a, b, true)
1307-
}
1307+
}
13081308
}
1309-

0 commit comments

Comments
 (0)