Use Sprintf instead of string concatenation.

This commit is contained in:
Johannes 'fish' Ziemke 2013-04-05 13:41:52 +02:00
parent 1c091a9723
commit 0f775a4178
1 changed files with 2 additions and 1 deletions

View File

@ -16,6 +16,7 @@ package web
import ( import (
"code.google.com/p/gorest" "code.google.com/p/gorest"
"flag" "flag"
"fmt"
"github.com/prometheus/client_golang" "github.com/prometheus/client_golang"
"github.com/prometheus/client_golang/exp" "github.com/prometheus/client_golang/exp"
"github.com/prometheus/prometheus/appstate" "github.com/prometheus/prometheus/appstate"
@ -53,7 +54,7 @@ func StartServing(appState *appstate.ApplicationState) {
func getTemplate(name string) (t *template.Template, err error) { func getTemplate(name string) (t *template.Template, err error) {
if *useLocalAssets { if *useLocalAssets {
return template.ParseFiles("web/templates/_base.html", "web/templates/"+name+".html") return template.ParseFiles("web/templates/_base.html", fmt.Sprintf("web/templates/%s.html", name))
} }
t = template.New("_base") t = template.New("_base")