Use Sprintf instead of string concatenation.
This commit is contained in:
parent
1c091a9723
commit
0f775a4178
|
@ -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")
|
||||||
|
|
Loading…
Reference in New Issue