mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Correct fmt.Fprintf and t.Fatalf
Signed-off-by: Helen Xie <chenjg@harmonycloud.cn>
This commit is contained in:
parent
41650df87e
commit
921002137a
2 changed files with 4 additions and 4 deletions
|
@ -29,13 +29,13 @@ func profilerSetup(mainRouter *mux.Router) {
|
|||
func expVars(w http.ResponseWriter, r *http.Request) {
|
||||
first := true
|
||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||
fmt.Fprintf(w, "{\n")
|
||||
fmt.Fprintln(w, "{")
|
||||
expvar.Do(func(kv expvar.KeyValue) {
|
||||
if !first {
|
||||
fmt.Fprintf(w, ",\n")
|
||||
fmt.Fprintln(w, ",")
|
||||
}
|
||||
first = false
|
||||
fmt.Fprintf(w, "%q: %s", kv.Key, kv.Value)
|
||||
})
|
||||
fmt.Fprintf(w, "\n}\n")
|
||||
fmt.Fprintln(w, "\n}")
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ func TestMiddlewares(t *testing.T) {
|
|||
|
||||
localHandler := func(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
|
||||
if httputils.VersionFromContext(ctx) == "" {
|
||||
t.Fatalf("Expected version, got empty string")
|
||||
t.Fatal("Expected version, got empty string")
|
||||
}
|
||||
|
||||
if sv := w.Header().Get("Server"); !strings.Contains(sv, "Docker/0.1omega2") {
|
||||
|
|
Loading…
Reference in a new issue