mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Gofmt
Command: `gofmt -l -s -w .`
This commit is contained in:
parent
1abc2f0b86
commit
6da23f7449
8 changed files with 30 additions and 32 deletions
|
@ -43,7 +43,6 @@ Complete documentation is available at http://hugo.spf13.com`,
|
|||
}
|
||||
var hugoCmdV *cobra.Command
|
||||
|
||||
|
||||
var BuildWatch, Draft, UglyUrls, Verbose bool
|
||||
var Source, Destination, BaseUrl, CfgFile string
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ func (p IndexedPages) Less(i, j int) bool {
|
|||
|
||||
func (ip IndexedPages) Pages() Pages {
|
||||
pages := make(Pages, len(ip))
|
||||
for i, _ := range ip {
|
||||
for i := range ip {
|
||||
pages[i] = ip[i].Page
|
||||
}
|
||||
return pages
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package hugolib
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"bytes"
|
||||
"github.com/spf13/hugo/source"
|
||||
"github.com/spf13/hugo/target"
|
||||
"testing"
|
||||
)
|
||||
|
||||
const RSS_TEMPLATE = `<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
|
|
|
@ -185,7 +185,7 @@ func Tokenize(in string) interface{} {
|
|||
|
||||
// No closing "... just make remainder the final token
|
||||
if inQuote && i == len(first) {
|
||||
final = append(final, first[start:len(first)]...)
|
||||
final = append(final, first[start:]...)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -326,7 +326,7 @@ func (s *Site) BuildSiteMeta() (err error) {
|
|||
}
|
||||
}
|
||||
}
|
||||
for k, _ := range s.Indexes[plural] {
|
||||
for k := range s.Indexes[plural] {
|
||||
s.Indexes[plural][k].Sort()
|
||||
}
|
||||
}
|
||||
|
@ -335,7 +335,7 @@ func (s *Site) BuildSiteMeta() (err error) {
|
|||
s.Sections.Add(p.Section, WeightedIndexEntry{s.Pages[i].Weight, s.Pages[i]})
|
||||
}
|
||||
|
||||
for k, _ := range s.Sections {
|
||||
for k := range s.Sections {
|
||||
s.Sections[k].Sort()
|
||||
}
|
||||
|
||||
|
@ -356,7 +356,7 @@ func (s *Site) BuildSiteMeta() (err error) {
|
|||
|
||||
func (s *Site) possibleIndexes() (indexes []string) {
|
||||
for _, p := range s.Pages {
|
||||
for k, _ := range p.Params {
|
||||
for k := range p.Params {
|
||||
if !inStringArray(indexes, k) {
|
||||
indexes = append(indexes, k)
|
||||
}
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
package hugolib
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"bytes"
|
||||
"testing"
|
||||
)
|
||||
|
||||
const SITE_INFO_PARAM_TEMPLATE = `{{ .Site.Params.MyGlobalParam }}`
|
||||
|
||||
|
||||
func TestSiteInfoParams(t *testing.T) {
|
||||
s := &Site{
|
||||
Config: Config{Params: map[string]interface{}{"MyGlobalParam": "FOOBAR_PARAM"}},
|
||||
|
|
Loading…
Reference in a new issue