From d55af2abf0548e627998d3905cfdec5b7b8f7ec3 Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Fri, 10 Mar 2023 20:18:41 +0100 Subject: [PATCH] Run gofmt -s on source files --- README.md | 2 +- common/loggers/loggers.go | 2 +- common/maps/params.go | 2 +- hugolib/pagecollections.go | 2 +- lazy/once.go | 2 +- resources/page/page_paths.go | 3 +-- tpl/templates/integration_test.go | 1 - watcher/filenotify/poller.go | 2 +- 8 files changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index b776e1326..a07c95e33 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ Hugo stands on the shoulder of many great open source libraries. If you run `hugo env -v` you will get a complete and up to date list. -In Hugo 0.110.2 that list is, in lexical order: +In Hugo 0.111.2 that list is, in lexical order: ``` cloud.google.com/go/compute="v1.6.1" diff --git a/common/loggers/loggers.go b/common/loggers/loggers.go index 2c331352a..824fe18bd 100644 --- a/common/loggers/loggers.go +++ b/common/loggers/loggers.go @@ -204,7 +204,7 @@ func (l *logger) Reset() { } } -// NewLogger creates a new Logger for the given thresholds +// NewLogger creates a new Logger for the given thresholds func NewLogger(stdoutThreshold, logThreshold jww.Threshold, outHandle, logHandle io.Writer, saveErrors bool) Logger { return newLogger(stdoutThreshold, logThreshold, outHandle, logHandle, saveErrors) } diff --git a/common/maps/params.go b/common/maps/params.go index 60fe56668..4bf95f43b 100644 --- a/common/maps/params.go +++ b/common/maps/params.go @@ -62,7 +62,7 @@ func (p Params) IsZero() bool { return false } - for k, _ := range p { + for k := range p { return k == mergeStrategyKey } diff --git a/hugolib/pagecollections.go b/hugolib/pagecollections.go index 0d901d6b2..6f7d291bc 100644 --- a/hugolib/pagecollections.go +++ b/hugolib/pagecollections.go @@ -143,7 +143,7 @@ func (c *PageCollections) getPageOldVersion(ref ...string) (page.Page, error) { return c.getPageNew(nil, key) } -// Only used in tests. +// Only used in tests. func (c *PageCollections) getPage(typ string, sections ...string) page.Page { refs := append([]string{typ}, path.Join(sections...)) p, _ := c.getPageOldVersion(refs...) diff --git a/lazy/once.go b/lazy/once.go index bdce12c33..c6abcd884 100644 --- a/lazy/once.go +++ b/lazy/once.go @@ -23,7 +23,7 @@ import ( // Additional features are: // * it can be reset, so the action can be repeated if needed // * it has methods to check if it's done or in progress -// + type onceMore struct { mu sync.Mutex lock uint32 diff --git a/resources/page/page_paths.go b/resources/page/page_paths.go index 3d34866d1..8c718fd77 100644 --- a/resources/page/page_paths.go +++ b/resources/page/page_paths.go @@ -30,8 +30,7 @@ const slash = "/" // // The big motivating behind this is to have only one source of truth for URLs, // and by that also get rid of most of the fragile string parsing/encoding etc. -// -// + type TargetPathDescriptor struct { PathSpec *helpers.PathSpec diff --git a/tpl/templates/integration_test.go b/tpl/templates/integration_test.go index d6ea9228d..7935fa5e3 100644 --- a/tpl/templates/integration_test.go +++ b/tpl/templates/integration_test.go @@ -84,7 +84,6 @@ post/doesnotexist.html: false `) } - // See #10774 func TestPageFunctionExists(t *testing.T) { t.Parallel() diff --git a/watcher/filenotify/poller.go b/watcher/filenotify/poller.go index 7479dcbdd..91e1e21b8 100644 --- a/watcher/filenotify/poller.go +++ b/watcher/filenotify/poller.go @@ -268,7 +268,7 @@ func (item *itemToWatch) checkForChanges() ([]fsnotify.Event, error) { dirOp := checkChange(item.left.FileInfo, item.right.FileInfo) if dirOp != 0 { - evs := []fsnotify.Event{fsnotify.Event{Op: dirOp, Name: item.filename}} + evs := []fsnotify.Event{{Op: dirOp, Name: item.filename}} return evs, nil }