Run gofmt -s on source files

This commit is contained in:
Andreas Deininger 2023-03-10 20:18:41 +01:00 committed by Bjørn Erik Pedersen
parent b6f44aaf1a
commit d55af2abf0
8 changed files with 7 additions and 9 deletions

View file

@ -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. 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" cloud.google.com/go/compute="v1.6.1"

View file

@ -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 { func NewLogger(stdoutThreshold, logThreshold jww.Threshold, outHandle, logHandle io.Writer, saveErrors bool) Logger {
return newLogger(stdoutThreshold, logThreshold, outHandle, logHandle, saveErrors) return newLogger(stdoutThreshold, logThreshold, outHandle, logHandle, saveErrors)
} }

View file

@ -62,7 +62,7 @@ func (p Params) IsZero() bool {
return false return false
} }
for k, _ := range p { for k := range p {
return k == mergeStrategyKey return k == mergeStrategyKey
} }

View file

@ -143,7 +143,7 @@ func (c *PageCollections) getPageOldVersion(ref ...string) (page.Page, error) {
return c.getPageNew(nil, key) return c.getPageNew(nil, key)
} }
// Only used in tests. // Only used in tests.
func (c *PageCollections) getPage(typ string, sections ...string) page.Page { func (c *PageCollections) getPage(typ string, sections ...string) page.Page {
refs := append([]string{typ}, path.Join(sections...)) refs := append([]string{typ}, path.Join(sections...))
p, _ := c.getPageOldVersion(refs...) p, _ := c.getPageOldVersion(refs...)

View file

@ -23,7 +23,7 @@ import (
// Additional features are: // Additional features are:
// * it can be reset, so the action can be repeated if needed // * it can be reset, so the action can be repeated if needed
// * it has methods to check if it's done or in progress // * it has methods to check if it's done or in progress
//
type onceMore struct { type onceMore struct {
mu sync.Mutex mu sync.Mutex
lock uint32 lock uint32

View file

@ -30,8 +30,7 @@ const slash = "/"
// //
// The big motivating behind this is to have only one source of truth for URLs, // 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. // and by that also get rid of most of the fragile string parsing/encoding etc.
//
//
type TargetPathDescriptor struct { type TargetPathDescriptor struct {
PathSpec *helpers.PathSpec PathSpec *helpers.PathSpec

View file

@ -84,7 +84,6 @@ post/doesnotexist.html: false
`) `)
} }
// See #10774 // See #10774
func TestPageFunctionExists(t *testing.T) { func TestPageFunctionExists(t *testing.T) {
t.Parallel() t.Parallel()

View file

@ -268,7 +268,7 @@ func (item *itemToWatch) checkForChanges() ([]fsnotify.Event, error) {
dirOp := checkChange(item.left.FileInfo, item.right.FileInfo) dirOp := checkChange(item.left.FileInfo, item.right.FileInfo)
if dirOp != 0 { if dirOp != 0 {
evs := []fsnotify.Event{fsnotify.Event{Op: dirOp, Name: item.filename}} evs := []fsnotify.Event{{Op: dirOp, Name: item.filename}}
return evs, nil return evs, nil
} }