commands, hugolib, source, target, tpl: Get rid of some fmt statements
authorbogem <albertnigma@gmail.com>
Fri, 18 Nov 2016 21:38:41 +0000 (22:38 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 22 Nov 2016 22:43:55 +0000 (23:43 +0100)
commands/convert.go
source/inmemory.go
target/page.go
tpl/template_i18n.go

index 411e51ec299509e9b7a1464362e3618c5b9cab5d..56f67f8dc07b4c6ad117b3b81a71887dd2ae7d75 100644 (file)
@@ -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")
index ebd07686b05f6154c03c026a928517da43bb6acf..9d3af5194db6bd7308bcea73e29308bc604d571b 100644 (file)
 
 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 {
index d67d678f9b4020ffb8a555a9bc81d99d79c7b294..eb7bb59435d398a65c39a116538856139a790f0e 100644 (file)
@@ -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 {
index 1bec65a78eca5163c0b8aa777fecfd09484955fe..a725856e4eacb4de94b9161bf4822f7b29b6e5c6 100644 (file)
@@ -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 {