1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

all: Format code with gofumpt

See https://github.com/mvdan/gofumpt
This commit is contained in:
Bjørn Erik Pedersen
2020-12-02 13:23:25 +01:00
parent 32471b57bd
commit d90e37e0c6
442 changed files with 1426 additions and 2254 deletions

View File

@ -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

View File

@ -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")...)