mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
related: Fix golint issues
related/inverted_index.go:76:1: exported method Config.Add should have comment or be unexported related/inverted_index.go:255:1: exported method IndexConfig.ToKeywords should have comment or be unexported
This commit is contained in:
parent
ccd3285484
commit
7231869ba8
1 changed files with 3 additions and 1 deletions
|
@ -73,6 +73,7 @@ type Config struct {
|
||||||
Indices IndexConfigs
|
Indices IndexConfigs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add adds a given index.
|
||||||
func (c *Config) Add(index IndexConfig) {
|
func (c *Config) Add(index IndexConfig) {
|
||||||
if c.ToLower {
|
if c.ToLower {
|
||||||
index.ToLower = true
|
index.ToLower = true
|
||||||
|
@ -252,6 +253,7 @@ func (idx *InvertedIndex) SearchDoc(doc Document, indices ...string) ([]Document
|
||||||
return idx.searchDate(doc.PubDate(), q...)
|
return idx.searchDate(doc.PubDate(), q...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ToKeywords returns a Keyword slice of the given input.
|
||||||
func (cfg IndexConfig) ToKeywords(v interface{}) ([]Keyword, error) {
|
func (cfg IndexConfig) ToKeywords(v interface{}) ([]Keyword, error) {
|
||||||
var (
|
var (
|
||||||
keywords []Keyword
|
keywords []Keyword
|
||||||
|
@ -279,7 +281,7 @@ func (cfg IndexConfig) ToKeywords(v interface{}) ([]Keyword, error) {
|
||||||
case nil:
|
case nil:
|
||||||
return keywords, nil
|
return keywords, nil
|
||||||
default:
|
default:
|
||||||
return keywords, fmt.Errorf("indexing currently not supported for for index %q and type %T", cfg.Name, vv)
|
return keywords, fmt.Errorf("indexing currently not supported for index %q and type %T", cfg.Name, vv)
|
||||||
}
|
}
|
||||||
|
|
||||||
return keywords, nil
|
return keywords, nil
|
||||||
|
|
Loading…
Reference in a new issue