diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-12-02 13:23:25 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-12-03 13:12:58 +0100 |
commit | d90e37e0c6e812f9913bf256c9c81aa05b7a08aa (patch) | |
tree | 7b1b14464eefec1188ca2eed53c64e4823453cc9 /navigation | |
parent | 32471b57bde51c55a15dbf1db75d6e5f7232c347 (diff) |
all: Format code with gofumpt
See https://github.com/mvdan/gofumpt
Diffstat (limited to 'navigation')
-rw-r--r-- | navigation/menu.go | 8 | ||||
-rw-r--r-- | navigation/pagemenus.go | 5 |
2 files changed, 4 insertions, 9 deletions
diff --git a/navigation/menu.go b/navigation/menu.go index 498078e34..1fb970c7c 100644 --- a/navigation/menu.go +++ b/navigation/menu.go @@ -14,14 +14,14 @@ package navigation import ( - "github.com/gohugoio/hugo/common/maps" - "github.com/gohugoio/hugo/common/types" - "github.com/gohugoio/hugo/compare" - "html/template" "sort" "strings" + "github.com/gohugoio/hugo/common/maps" + "github.com/gohugoio/hugo/common/types" + "github.com/gohugoio/hugo/compare" + "github.com/spf13/cast" ) diff --git a/navigation/pagemenus.go b/navigation/pagemenus.go index 352a91557..1dfa71255 100644 --- a/navigation/pagemenus.go +++ b/navigation/pagemenus.go @@ -94,7 +94,6 @@ func PageMenusFromPage(p Page) (PageMenus, error) { } return pm, nil - } func NewMenuQueryProvider( @@ -102,7 +101,6 @@ func NewMenuQueryProvider( pagem PageMenusGetter, sitem MenusGetter, p Page) MenuQueryProvider { - return &pageMenus{ p: p, pagem: pagem, @@ -119,7 +117,6 @@ type pageMenus struct { } func (pm *pageMenus) HasMenuCurrent(menuID string, me *MenuEntry) bool { - // page is labeled as "shadow-member" of the menu with the same identifier as the section if pm.setionPagesMenu != "" { section := pm.p.Section() @@ -136,7 +133,6 @@ func (pm *pageMenus) HasMenuCurrent(menuID string, me *MenuEntry) bool { menus := pm.pagem.Menus() if m, ok := menus[menuID]; ok { - for _, child := range me.Children { if child.IsEqual(m) { return true @@ -165,7 +161,6 @@ func (pm *pageMenus) HasMenuCurrent(menuID string, me *MenuEntry) bool { } return false - } func (pm *pageMenus) IsMenuCurrent(menuID string, inme *MenuEntry) bool { |