mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-24 21:56:05 +02:00
hugolib: apply some more Golint rules
This commit is contained in:
@@ -184,18 +184,18 @@ func (wp WeightedPages) Next(cur *Page) *Page {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p WeightedPages) Len() int { return len(p) }
|
||||
func (p WeightedPages) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
|
||||
func (p WeightedPages) Sort() { sort.Stable(p) }
|
||||
func (p WeightedPages) Count() int { return len(p) }
|
||||
func (p WeightedPages) Less(i, j int) bool {
|
||||
if p[i].Weight == p[j].Weight {
|
||||
if p[i].Page.Date.Equal(p[j].Page.Date) {
|
||||
return p[i].Page.Title < p[j].Page.Title
|
||||
func (wp WeightedPages) Len() int { return len(wp) }
|
||||
func (wp WeightedPages) Swap(i, j int) { wp[i], wp[j] = wp[j], wp[i] }
|
||||
func (wp WeightedPages) Sort() { sort.Stable(wp) }
|
||||
func (wp WeightedPages) Count() int { return len(wp) }
|
||||
func (wp WeightedPages) Less(i, j int) bool {
|
||||
if wp[i].Weight == wp[j].Weight {
|
||||
if wp[i].Page.Date.Equal(wp[j].Page.Date) {
|
||||
return wp[i].Page.Title < wp[j].Page.Title
|
||||
}
|
||||
return p[i].Page.Date.After(p[i].Page.Date)
|
||||
return wp[i].Page.Date.After(wp[i].Page.Date)
|
||||
}
|
||||
return p[i].Weight < p[j].Weight
|
||||
return wp[i].Weight < wp[j].Weight
|
||||
}
|
||||
|
||||
// TODO mimic PagesSorter for WeightedPages
|
||||
|
Reference in New Issue
Block a user