mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 22:21:07 +03:00
all: Apply staticcheck recommendations
This commit is contained in:
parent
3011f36c27
commit
b5f39d23b8
41 changed files with 98 additions and 252 deletions
|
@ -20,12 +20,10 @@ import (
|
|||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/bep/gitmap"
|
||||
"github.com/spf13/cast"
|
||||
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
|
||||
|
@ -831,19 +829,6 @@ func (ps pageStatePages) findPagePosByFilnamePrefix(prefix string) int {
|
|||
return currPos
|
||||
}
|
||||
|
||||
func content(c resource.ContentProvider) string {
|
||||
cc, err := c.Content()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
ccs, err := cast.ToStringE(cc)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return ccs
|
||||
}
|
||||
|
||||
func (s *Site) sectionsFromFile(fi source.File) []string {
|
||||
dirname := fi.Dir()
|
||||
dirname = strings.Trim(dirname, helpers.FilePathSeparator)
|
||||
|
@ -861,9 +846,3 @@ func (s *Site) sectionsFromFile(fi source.File) []string {
|
|||
|
||||
return parts
|
||||
}
|
||||
|
||||
func printStackTrace(length int) string {
|
||||
trace := make([]byte, length)
|
||||
runtime.Stack(trace, true)
|
||||
return string(trace)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue