1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-14 05:28:27 +00:00

format with gofumpt (#18184)

* gofumpt -w -l .

* gofumpt -w -l -extra .

* Add linter

* manual fix

* change make fmt
This commit is contained in:
6543
2022-01-20 18:46:10 +01:00
committed by GitHub
parent 1d98d205f5
commit 54e9ee37a7
423 changed files with 1585 additions and 1758 deletions

View File

@@ -16,9 +16,7 @@ import (
"github.com/olivere/elastic/v7"
)
var (
_ Indexer = &ElasticSearchIndexer{}
)
var _ Indexer = &ElasticSearchIndexer{}
// ElasticSearchIndexer implements Indexer interface
type ElasticSearchIndexer struct {
@@ -102,7 +100,7 @@ func (b *ElasticSearchIndexer) Init() (bool, error) {
}
if !exists {
var mapping = defaultMapping
mapping := defaultMapping
createIndex, err := b.client.CreateIndex(b.indexerName).BodyString(mapping).Do(ctx)
if err != nil {
@@ -195,7 +193,7 @@ func (b *ElasticSearchIndexer) Search(keyword string, repoIDs []int64, limit, st
query := elastic.NewBoolQuery()
query = query.Must(kwQuery)
if len(repoIDs) > 0 {
var repoStrs = make([]interface{}, 0, len(repoIDs))
repoStrs := make([]interface{}, 0, len(repoIDs))
for _, repoID := range repoIDs {
repoStrs = append(repoStrs, repoID)
}