shithub: hugo

Download patch

ref: a792ec09ce8dd7bc2d28330d631f04aea8ec3565
parent: 4ed43e8076f43bfab371868f6986f583381190b4
author: Noah Campbell <[email protected]>
date: Fri Aug 30 10:38:33 EDT 2013

Cleanup formatting - go fmt ./...

Remember to run go fmt ./... before committing.  Looks sternly in mirror

--- a/hugolib/helpers.go
+++ b/hugolib/helpers.go
@@ -334,7 +334,7 @@
 }
 
 func getSummaryString(content []byte) ([]byte, bool) {
-	if (bytes.Contains(content, summaryDivider)) {
+	if bytes.Contains(content, summaryDivider) {
 		return bytes.Split(content, summaryDivider)[0], false
 	} else {
 		plainContent := StripHTML(StripShortcodes(string(content)))
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -121,7 +121,7 @@
 	site.timerStep("render pages")
 	if err = site.RenderHomePage(); err != nil {
 		return
-        }
+	}
 	site.timerStep("render and write homepage")
 	return
 }
@@ -203,7 +203,7 @@
 
 	s.checkDirectories()
 
-	staticDir := s.Config.GetAbsPath(s.Config.StaticDir+"/")
+	staticDir := s.Config.GetAbsPath(s.Config.StaticDir + "/")
 
 	walker := func(path string, fi os.FileInfo, err error) error {
 		if err != nil {
@@ -212,7 +212,7 @@
 		}
 
 		if fi.IsDir() {
-			if (path == staticDir) {
+			if path == staticDir {
 				return filepath.SkipDir
 			}
 			site.Directories = append(site.Directories, path)
@@ -432,7 +432,7 @@
 func (s *Site) RenderAliases() error {
 	for i, p := range s.Pages {
 		for _, a := range p.Aliases {
-			t := "alias";
+			t := "alias"
 			if strings.HasSuffix(a, ".xhtml") {
 				t = "alias-xhtml"
 			}
--- a/hugolib/site_test.go
+++ b/hugolib/site_test.go
@@ -1,8 +1,8 @@
 package hugolib
 
 import (
-	"fmt"
 	"bytes"
+	"fmt"
 	"strings"
 	"testing"
 )
@@ -164,16 +164,17 @@
 		if string(html.Bytes()) != test.expected {
 			t.Errorf("Content does not match.  Expected '%s', got '%s'", test.expected, html)
 		}
-	}}
+	}
+}
 
 func TestSetOutFile(t *testing.T) {
-    s := new(Site)
+	s := new(Site)
 	p := pageMust(ReadFrom(strings.NewReader(PAGE_URL_SPECIFIED), "content/a/file.md"))
-    s.setOutFile(p)
+	s.setOutFile(p)
 
-    expected := "mycategory/my-whatever-content/index.html"
+	expected := "mycategory/my-whatever-content/index.html"
 
-    if p.OutFile != "mycategory/my-whatever-content/index.html" {
-        t.Errorf("Outfile does not match.  Expected '%s', got '%s'", expected, p.OutFile)
-    }
+	if p.OutFile != "mycategory/my-whatever-content/index.html" {
+		t.Errorf("Outfile does not match.  Expected '%s', got '%s'", expected, p.OutFile)
+	}
 }