all: Changing Printf and friends to Print if there is no formatting

Signed-off-by: Sasha Melentyev <sasha@melentyev.io>
This commit is contained in:
Sasha Melentyev
2022-11-15 22:10:25 +03:00
parent a6997644c3
commit 2c9c209eb6
18 changed files with 40 additions and 41 deletions

View File

@@ -34,14 +34,14 @@ func serveVars(w http.ResponseWriter, r *http.Request) {
}
w.Header().Set("Content-Type", "application/json; charset=utf-8")
fmt.Fprintf(w, "{\n")
fmt.Fprint(w, "{\n")
first := true
expvar.Do(func(kv expvar.KeyValue) {
if !first {
fmt.Fprintf(w, ",\n")
fmt.Fprint(w, ",\n")
}
first = false
fmt.Fprintf(w, "%q: %s", kv.Key, kv.Value)
})
fmt.Fprintf(w, "\n}\n")
fmt.Fprint(w, "\n}\n")
}