Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

all: fix printf(var) mistakes newly found in golang.org/x repos #69267

Closed
dmitshur opened this issue Sep 4, 2024 · 11 comments
Closed

all: fix printf(var) mistakes newly found in golang.org/x repos #69267

dmitshur opened this issue Sep 4, 2024 · 11 comments
Assignees
Labels
NeedsFix The path to resolution is known, but the work has not been done. Soon This needs action soon. (recent regressions, service outages, unusual time-sensitive situations)
Milestone

Comments

@dmitshur
Copy link
Contributor

dmitshur commented Sep 4, 2024

Some golang.org/x repos have new findings from issue #68796 being resolved.
This issue is to track fixing them all.

CC @adonovan.

@dmitshur dmitshur added the NeedsFix The path to resolution is known, but the work has not been done. label Sep 4, 2024
@dmitshur dmitshur added this to the Unreleased milestone Sep 4, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610816 mentions this issue: all: fix printf(var) mistakes detected by latest printf checker

gopherbot pushed a commit to golang/build that referenced this issue Sep 4, 2024
All of these fmt.Sprintf calls aren't needed.

For golang/go#69267.

Change-Id: Ie8e2719e1e94bac3810d4975a349614316e6e0d2
Reviewed-on: https://go-review.googlesource.com/c/build/+/610816
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Funda Secgin <fundasecgin38@gmail.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
@dmitshur
Copy link
Contributor Author

dmitshur commented Sep 4, 2024

List of golang.org/x repos that need attention:

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610799 mentions this issue: websocket: fix printf(var) mistake detected by latest printf checker

gopherbot pushed a commit to golang/net that referenced this issue Sep 4, 2024
For golang/go#69267.

Change-Id: Ica6d123312495966ad6d222d67944fd602216853
Reviewed-on: https://go-review.googlesource.com/c/net/+/610799
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610676 mentions this issue: all: fix printf(var) mistakes detected by latest printf checker

@dmitshur dmitshur added the Soon This needs action soon. (recent regressions, service outages, unusual time-sensitive situations) label Sep 4, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610915 mentions this issue: all: fix printf(var) mistakes detected by latest printf checker

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610935 mentions this issue: rand: fix printf(var) mistake detected by latest printf checker

gopherbot pushed a commit to golang/text that referenced this issue Sep 4, 2024
The CodeWriter.WriteComment method is odd. It calls fmt.Sprintf
on its arguments so the caller doesn't need to, but isn't named
something like WriteCommentf as I'd expect. I tried renaming it,
but it became a bigger change than I wanted. Leaving that for a
future CL - this one just fixes clear mistakes to fix the build.

For golang/go#69267.

Change-Id: Ifba42d4512696194fbf21d6c8d3da76440b1ce9e
Reviewed-on: https://go-review.googlesource.com/c/text/+/610676
Reviewed-by: Tim King <taking@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610800 mentions this issue: all: fix printf(var) mistakes detected by latest printf checker

gopherbot pushed a commit to golang/exp that referenced this issue Sep 4, 2024
For golang/go#69267.

Change-Id: I28b189236bfa7a7efc4a11a8585d358fbce75ec1
Reviewed-on: https://go-review.googlesource.com/c/exp/+/610935
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Tim King <taking@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610955 mentions this issue: all: fix printf(var) mistakes detected by latest printf checker

gopherbot pushed a commit to golang/vulndb that referenced this issue Sep 4, 2024
This includes testdata files that incorrectly formatted "%40l".

For golang/go#69267.

Change-Id: Ibd22b65c89382b386452f0a5b442bb94a4c03c22
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/610955
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610517 mentions this issue: all: fix printf(var) mistake detected by latest printf checker

gopherbot pushed a commit to golang/benchmarks that referenced this issue Sep 5, 2024
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>
gopherbot pushed a commit to golang/mobile that referenced this issue Sep 5, 2024
There's some similarity here to the situation in CL 610676. The calls
that now look like g.Printf("%s", something) would perhaps be better
expressed like g.Print(something) or g.WriteString(something), but
that's a bigger potential change to consider. This is a minimal fix.

For golang/go#69267.

Change-Id: I9cf23aef7bf2b9d9c7e9dcf3b48ecb23231016dd
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/610800
Reviewed-by: Tim King <taking@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Sep 5, 2024
For golang/go#69267.

Change-Id: I050c167e2e3ce36541e0d71469fb3f5778f5a882
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/610517
Reviewed-by: Ian Lance Taylor <iant@google.com>
kokoro-CI: kokoro <noreply+kokoro@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
@dmitshur
Copy link
Contributor Author

dmitshur commented Sep 5, 2024

I believe all are updated. Please comment or re-open if some repo was missed.
Thanks @adonovan, @timothy-king, @ianlancetaylor.

@dmitshur dmitshur closed this as completed Sep 5, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610940 mentions this issue: windows/svc: fix printf(var) mistake detected by latest printf checker

gopherbot pushed a commit to golang/sys that referenced this issue Sep 6, 2024
For golang/go#69267.

Change-Id: Ie240b5c826bb96c0e2021a7e99a3c0f973f0a0e1
Reviewed-on: https://go-review.googlesource.com/c/sys/+/610940
Reviewed-by: Tim King <taking@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
hajimehoshi pushed a commit to ebitengine/gomobile that referenced this issue Sep 11, 2024
There's some similarity here to the situation in CL 610676. The calls
that now look like g.Printf("%s", something) would perhaps be better
expressed like g.Print(something) or g.WriteString(something), but
that's a bigger potential change to consider. This is a minimal fix.

For golang/go#69267.

Change-Id: I9cf23aef7bf2b9d9c7e9dcf3b48ecb23231016dd
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/610800
Reviewed-by: Tim King <taking@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done. Soon This needs action soon. (recent regressions, service outages, unusual time-sensitive situations)
Projects
None yet
Development

No branches or pull requests

3 participants