diff options
| author | Shulhan <ms@kilabit.info> | 2018-11-30 10:23:29 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2018-11-30 10:23:29 +0700 |
| commit | 645c7bb752465782a4e46b703c5250d345b495bd (patch) | |
| tree | e0099dbc8dce592b2e491c19c8ae41bfc68c6b68 /lib/text | |
| parent | b077d6796655e1be9864e0c64068bdcd5d1d2649 (diff) | |
| download | pakakeh.go-645c7bb752465782a4e46b703c5250d345b495bd.tar.xz | |
all: fix linter warnings on naked return
Diffstat (limited to 'lib/text')
| -rw-r--r-- | lib/text/diff/diffinterface.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/text/diff/diffinterface.go b/lib/text/diff/diffinterface.go index c29a188f..5ea7b5e7 100644 --- a/lib/text/diff/diffinterface.go +++ b/lib/text/diff/diffinterface.go @@ -458,7 +458,7 @@ func Lines(old, new []byte, atx, aty int) (adds, dels text.Chunks) { v := old[x:] dels = append(dels, text.Chunk{StartAt: atx + x, V: v}) } - return + return adds, dels } // Find the position of unmatched byte from the end @@ -477,14 +477,14 @@ func Lines(old, new []byte, atx, aty int) (adds, dels text.Chunks) { if x == xend+1 { v := new[y : yend+1] adds = append(adds, text.Chunk{StartAt: aty + y, V: v}) - return + return adds, dels } // Case 3: deletion in old line. if y == yend+1 { v := old[x : xend+1] dels = append(dels, text.Chunk{StartAt: atx + x, V: v}) - return + return adds, dels } // Calculate possible match len. @@ -535,7 +535,7 @@ func Lines(old, new []byte, atx, aty int) (adds, dels text.Chunks) { V: newleft, }) } - return + return adds, dels } if len(newleft) == 0 { if len(oldleft) > 0 { @@ -544,7 +544,7 @@ func Lines(old, new []byte, atx, aty int) (adds, dels text.Chunks) { V: oldleft, }) } - return + return adds, dels } } @@ -574,7 +574,7 @@ func Lines(old, new []byte, atx, aty int) (adds, dels text.Chunks) { dels = append(dels, delsleft...) } - return + return adds, dels } func searchForward(atx, aty int, x, y *int, oldleft, newleft *[]byte) ( |
