mirror of
https://github.com/prometheus/prometheus
synced 2025-01-30 03:33:32 +00:00
Use Sprintf instead of string concatenation.
This commit is contained in:
parent
1c091a9723
commit
0f775a4178
@ -16,6 +16,7 @@ package web
|
||||
import (
|
||||
"code.google.com/p/gorest"
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/prometheus/client_golang"
|
||||
"github.com/prometheus/client_golang/exp"
|
||||
"github.com/prometheus/prometheus/appstate"
|
||||
@ -53,7 +54,7 @@ func StartServing(appState *appstate.ApplicationState) {
|
||||
|
||||
func getTemplate(name string) (t *template.Template, err error) {
|
||||
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")
|
||||
|
Loading…
Reference in New Issue
Block a user