summaryrefslogtreecommitdiffstats
path: root/related
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-12-02 13:23:25 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-12-03 13:12:58 +0100
commitd90e37e0c6e812f9913bf256c9c81aa05b7a08aa (patch)
tree7b1b14464eefec1188ca2eed53c64e4823453cc9 /related
parent32471b57bde51c55a15dbf1db75d6e5f7232c347 (diff)
all: Format code with gofumpt
See https://github.com/mvdan/gofumpt
Diffstat (limited to 'related')
-rw-r--r--related/inverted_index.go1
-rw-r--r--related/inverted_index_test.go9
2 files changed, 1 insertions, 9 deletions
diff --git a/related/inverted_index.go b/related/inverted_index.go
index 79dd4577c..2e0ea295d 100644
--- a/related/inverted_index.go
+++ b/related/inverted_index.go
@@ -180,7 +180,6 @@ func (idx *InvertedIndex) Add(docs ...Document) error {
}
return err
-
}
// queryElement holds the index name and keywords that can be used to compose a
diff --git a/related/inverted_index_test.go b/related/inverted_index_test.go
index 576928aea..fdef06b13 100644
--- a/related/inverted_index_test.go
+++ b/related/inverted_index_test.go
@@ -86,7 +86,6 @@ func (d *testDoc) PublishDate() time.Time {
}
func TestSearch(t *testing.T) {
-
config := Config{
Threshold: 90,
IncludeNewer: false,
@@ -97,7 +96,7 @@ func TestSearch(t *testing.T) {
}
idx := NewInvertedIndex(config)
- //idx.debug = true
+ // idx.debug = true
docs := []Document{
newTestDoc("tags", "a", "b", "c", "d"),
@@ -119,7 +118,6 @@ func TestSearch(t *testing.T) {
set2, found := idx.index["keywords"]
c.Assert(found, qt.Equals, true)
c.Assert(len(set2), qt.Equals, 2)
-
})
t.Run("search-tags", func(t *testing.T) {
@@ -198,7 +196,6 @@ func TestSearch(t *testing.T) {
c.Assert(m[i].Name(), qt.Equals, fmt.Sprintf("doc%d", i))
}
})
-
}
func TestToKeywordsToLower(t *testing.T) {
@@ -213,11 +210,9 @@ func TestToKeywordsToLower(t *testing.T) {
StringKeyword("b"),
StringKeyword("c"),
})
-
}
func BenchmarkRelatedNewIndex(b *testing.B) {
-
pages := make([]*testDoc, 100)
numkeywords := 30
allKeywords := make([]string, numkeywords)
@@ -272,11 +267,9 @@ func BenchmarkRelatedNewIndex(b *testing.B) {
idx.Add(docs...)
}
})
-
}
func BenchmarkRelatedMatchesIn(b *testing.B) {
-
q1 := newQueryElement("tags", StringsToKeywords("keyword2", "keyword5", "keyword32", "asdf")...)
q2 := newQueryElement("keywords", StringsToKeywords("keyword3", "keyword4")...)