Skip to content

Commit

Permalink
all: fix printf(var) mistakes detected by latest printf checker
Browse files Browse the repository at this point in the history
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 <dmitshur@google.com>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Tim King <taking@google.com>
  • Loading branch information
dmitshur authored and gopherbot committed Sep 5, 2024
1 parent b7c1293 commit fff5323
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func makeOneRequest() bool {
log.Fatalf("ReadAll: %v", err)
}
if s := string(b); s != "Hello world.\n" {
log.Fatalf("Got body: " + s)
log.Fatalf("Got body: %q", s)
}
return true
}
Expand Down
4 changes: 2 additions & 2 deletions sweet/generators/tile38.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (Tile38) Generate(cfg *common.GenConfig) error {
if err != nil {
log.Printf("=== Server stdout+stderr ===")
for _, line := range strings.Split(buf.String(), "\n") {
log.Printf(line)
log.Print(line)
}
return fmt.Errorf("error: starting server: %w", err)
}
Expand All @@ -132,7 +132,7 @@ func (Tile38) Generate(cfg *common.GenConfig) error {
if err != nil && buf.Len() != 0 {
log.Printf("=== Server stdout+stderr ===")
for _, line := range strings.Split(buf.String(), "\n") {
log.Printf(line)
log.Print(line)
}
}
if err == nil {
Expand Down

0 comments on commit fff5323

Please # to comment.