From d4b63381029b477d064d4c3ff38f4efb89ae950d Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 14 Aug 2016 17:51:34 +0900 Subject: [PATCH] Lint --- src/item.go | 1 + src/matcher.go | 2 +- src/merger.go | 2 +- src/pattern.go | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/item.go b/src/item.go index 36f8c0a..584dfd8 100644 --- a/src/item.go +++ b/src/item.go @@ -44,6 +44,7 @@ func buildEmptyRank(index int32) [5]int32 { return [5]int32{0, 0, 0, 0, index} } +// Index returns ordinal index of the Item func (item *Item) Index() int32 { return item.rank[4] } diff --git a/src/matcher.go b/src/matcher.go index d320697..d2a7b38 100644 --- a/src/matcher.go +++ b/src/matcher.go @@ -200,7 +200,7 @@ func (m *Matcher) scan(request MatchRequest) (*Merger, bool) { } partialResults := make([][]*Item, numSlices) - for _, _ = range slices { + for _ = range slices { partialResult := <-resultChan partialResults[partialResult.index] = partialResult.matches } diff --git a/src/merger.go b/src/merger.go index 26ed17b..0d3fb80 100644 --- a/src/merger.go +++ b/src/merger.go @@ -2,7 +2,7 @@ package fzf import "fmt" -// Merger with no data +// EmptyMerger is a Merger with no data var EmptyMerger = NewMerger([][]*Item{}, false, false) // Merger holds a set of locally sorted lists of items and provides the view of diff --git a/src/pattern.go b/src/pattern.go index 2df2879..0bf9af3 100644 --- a/src/pattern.go +++ b/src/pattern.go @@ -372,8 +372,8 @@ func (p *Pattern) iter(pfun func(bool, bool, util.Chars, []rune) algo.Result, for _, part := range tokens { prefixLength := int32(part.prefixLength) if res := pfun(caseSensitive, forward, part.text, pattern); res.Start >= 0 { - var sidx int32 = res.Start + prefixLength - var eidx int32 = res.End + prefixLength + sidx := res.Start + prefixLength + eidx := res.End + prefixLength return Offset{sidx, eidx, int32(part.trimLength)}, res.Bonus } }