Skip to content

Commit fff5323

Browse files
dmitshurgopherbot
authored andcommitted
all: fix printf(var) mistakes detected by latest printf checker
Used %q instead of %s when reporting an unexpected body to make potential non-printable characters easier to see. For golang/go#69267. Change-Id: Ice78a175df5770afd20189b93c9659b9e966c9bb Reviewed-on: https://go-review.googlesource.com/c/benchmarks/+/610915 Reviewed-by: Dmitri Shuralyov <[email protected]> TryBot-Bypass: Dmitri Shuralyov <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]> Reviewed-by: Tim King <[email protected]>
1 parent b7c1293 commit fff5323

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

http/http.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func makeOneRequest() bool {
5656
log.Fatalf("ReadAll: %v", err)
5757
}
5858
if s := string(b); s != "Hello world.\n" {
59-
log.Fatalf("Got body: " + s)
59+
log.Fatalf("Got body: %q", s)
6060
}
6161
return true
6262
}

sweet/generators/tile38.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func (Tile38) Generate(cfg *common.GenConfig) error {
106106
if err != nil {
107107
log.Printf("=== Server stdout+stderr ===")
108108
for _, line := range strings.Split(buf.String(), "\n") {
109-
log.Printf(line)
109+
log.Print(line)
110110
}
111111
return fmt.Errorf("error: starting server: %w", err)
112112
}
@@ -132,7 +132,7 @@ func (Tile38) Generate(cfg *common.GenConfig) error {
132132
if err != nil && buf.Len() != 0 {
133133
log.Printf("=== Server stdout+stderr ===")
134134
for _, line := range strings.Split(buf.String(), "\n") {
135-
log.Printf(line)
135+
log.Print(line)
136136
}
137137
}
138138
if err == nil {

0 commit comments

Comments
 (0)