shithub: hugo

Download patch

ref: 937592cb85f6b4bf4603230050ac0afdcc93058b
parent: 8a60571fd2bd95f77c25d50daf285196e91a266a
author: Bjørn Erik Pedersen <[email protected]>
date: Wed Mar 23 06:10:28 EDT 2016

hugolib: Fix some more Golint warnings

--- a/hugolib/page_taxonomy_test.go
+++ b/hugolib/page_taxonomy_test.go
@@ -18,13 +18,13 @@
 	"testing"
 )
 
-var PAGE_YAML_WITH_TAXONOMIES_A = `---
+var pageYamlWithTaxonomiesA = `---
 tags: ['a', 'B', 'c']
 categories: 'd'
 ---
 YAML frontmatter with tags and categories taxonomy.`
 
-var PAGE_YAML_WITH_TAXONOMIES_B = `---
+var pageYamlWithTaxonomiesB = `---
 tags:
  - "a"
  - "B"
@@ -33,13 +33,13 @@
 ---
 YAML frontmatter with tags and categories taxonomy.`
 
-var PAGE_YAML_WITH_TAXONOMIES_C = `---
+var pageYamlWithTaxonomiesC = `---
 tags: 'E'
 categories: 'd'
 ---
 YAML frontmatter with tags and categories taxonomy.`
 
-var PAGE_JSON_WITH_TAXONOMIES = `{
+var pageJSONWithTaxonomies = `{
   "categories": "D",
   "tags": [
     "a",
@@ -49,7 +49,7 @@
 }
 JSON Front Matter with tags and categories`
 
-var PAGE_TOML_WITH_TAXONOMIES = `+++
+var pageTomlWithTaxonomies = `+++
 tags = [ "a", "B", "c" ]
 categories = "d"
 +++
@@ -56,11 +56,11 @@
 TOML Front Matter with tags and categories`
 
 func TestParseTaxonomies(t *testing.T) {
-	for _, test := range []string{PAGE_TOML_WITH_TAXONOMIES,
-		PAGE_JSON_WITH_TAXONOMIES,
-		PAGE_YAML_WITH_TAXONOMIES_A,
-		PAGE_YAML_WITH_TAXONOMIES_B,
-		PAGE_YAML_WITH_TAXONOMIES_C,
+	for _, test := range []string{pageTomlWithTaxonomies,
+		pageJSONWithTaxonomies,
+		pageYamlWithTaxonomiesA,
+		pageYamlWithTaxonomiesB,
+		pageYamlWithTaxonomiesC,
 	} {
 
 		p, _ := NewPage("page/with/taxonomy")
--- a/hugolib/shortcode_test.go
+++ b/hugolib/shortcode_test.go
@@ -534,7 +534,7 @@
 		{strings.Repeat("A ", 3000) + " {#{#HUGOSHORTCODE-1#}#}." + strings.Repeat("BC ", 1000) + " {#{#HUGOSHORTCODE-1#}#}.", map[string]string{"{#{#HUGOSHORTCODE-1#}#}": "Hello World"}, []byte(strings.Repeat("A ", 3000) + " Hello World." + strings.Repeat("BC ", 1000) + " Hello World.")},
 	}
 
-	var in []input = make([]input, b.N*len(data))
+	var in = make([]input, b.N*len(data))
 	var cnt = 0
 	for i := 0; i < b.N; i++ {
 		for _, this := range data {
--- a/hugolib/sitemap.go
+++ b/hugolib/sitemap.go
@@ -18,6 +18,7 @@
 	jww "github.com/spf13/jwalterweatherman"
 )
 
+// Sitemap configures the sitemap to be generated.
 type Sitemap struct {
 	ChangeFreq string
 	Priority   float64
--- a/hugolib/taxonomy_test.go
+++ b/hugolib/taxonomy_test.go
@@ -20,7 +20,7 @@
 
 func TestSitePossibleTaxonomies(t *testing.T) {
 	site := new(Site)
-	page, _ := NewPageFrom(strings.NewReader(PAGE_YAML_WITH_TAXONOMIES_A), "path/to/page")
+	page, _ := NewPageFrom(strings.NewReader(pageYamlWithTaxonomiesA), "path/to/page")
 	site.Pages = append(site.Pages, page)
 	taxonomies := site.possibleTaxonomies()
 	if !compareStringSlice(taxonomies, []string{"tags", "categories"}) {