forked from forgejo/forgejo
format with gofumpt (#18184)
* gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
This commit is contained in:
parent
1d98d205f5
commit
54e9ee37a7
423 changed files with 1585 additions and 1758 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue