summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbogem <albertnigma@gmail.com>2016-11-18 22:38:41 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-11-22 23:43:55 +0100
commit1f130fd69247aa3ae2e08560cd56537b32ef3d80 (patch)
tree6268e1aab055c7e144ac7827763b9dab6b70926b
parent120f6b0cf20dfc977f33e650530d866e28e52a28 (diff)
commands, hugolib, source, target, tpl: Get rid of some fmt statements
-rw-r--r--commands/convert.go2
-rw-r--r--source/inmemory.go7
-rw-r--r--target/page.go5
-rw-r--r--tpl/template_i18n.go4
4 files changed, 6 insertions, 12 deletions
diff --git a/commands/convert.go b/commands/convert.go
index 411e51ec2..56f67f8dc 100644
--- a/commands/convert.go
+++ b/commands/convert.go
@@ -97,7 +97,7 @@ func convertContents(mark rune) (err error) {
}
if site.Source == nil {
- panic(fmt.Sprintf("site.Source not set"))
+ panic("site.Source not set")
}
if len(site.Source.Files()) < 1 {
return fmt.Errorf("No source files found")
diff --git a/source/inmemory.go b/source/inmemory.go
index ebd07686b..9d3af5194 100644
--- a/source/inmemory.go
+++ b/source/inmemory.go
@@ -13,10 +13,7 @@
package source
-import (
- "bytes"
- "fmt"
-)
+import "bytes"
type ByteSource struct {
Name string
@@ -24,7 +21,7 @@ type ByteSource struct {
}
func (b *ByteSource) String() string {
- return fmt.Sprintf("%s %s", b.Name, string(b.Content))
+ return b.Name + " " + string(b.Content)
}
type InMemorySource struct {
diff --git a/target/page.go b/target/page.go
index d67d678f9..eb7bb5943 100644
--- a/target/page.go
+++ b/target/page.go
@@ -14,7 +14,6 @@
package target
import (
- "fmt"
"html/template"
"io"
"path/filepath"
@@ -66,10 +65,10 @@ func (pp *PagePub) TranslateRelative(src string) (dest string, err error) {
name := filename(file)
if pp.UglyURLs || file == "index.html" || (isRoot && file == "404.html") {
- return filepath.Join(dir, fmt.Sprintf("%s%s", name, ext)), nil
+ return filepath.Join(dir, name+ext), nil
}
- return filepath.Join(dir, name, fmt.Sprintf("index%s", ext)), nil
+ return filepath.Join(dir, name, "index"+ext), nil
}
func (pp *PagePub) extension(ext string) string {
diff --git a/tpl/template_i18n.go b/tpl/template_i18n.go
index 1bec65a78..a725856e4 100644
--- a/tpl/template_i18n.go
+++ b/tpl/template_i18n.go
@@ -14,8 +14,6 @@
package tpl
import (
- "fmt"
-
"github.com/nicksnyder/go-i18n/i18n/bundle"
"github.com/spf13/hugo/helpers"
jww "github.com/spf13/jwalterweatherman"
@@ -80,7 +78,7 @@ func SetI18nTfuncs(bndl *bundle.Bundle) {
i18nWarningLogger.Printf("i18n|MISSING_TRANSLATION|%s|%s", currentLang, translationID)
}
if enableMissingTranslationPlaceholders {
- return fmt.Sprintf("[i18n] %s", translationID)
+ return "[i18n] " + translationID
}
if defaultT != nil {
if translated := defaultT(translationID, args...); translated != translationID {