From d90e37e0c6e812f9913bf256c9c81aa05b7a08aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 2 Dec 2020 13:23:25 +0100 Subject: all: Format code with gofumpt See https://github.com/mvdan/gofumpt --- navigation/menu.go | 8 ++++---- navigation/pagemenus.go | 5 ----- 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'navigation') 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 { -- cgit v1.2.3