]> Cypherpunks repositories - gostls13.git/commit
fmt: don't pad strings with zeros
authorRob Pike <r@golang.org>
Sun, 14 Jan 2024 04:34:49 +0000 (15:34 +1100)
committerM Zhuo <mzh@golangcn.org>
Tue, 23 Jan 2024 08:29:53 +0000 (08:29 +0000)
commit704401ffa06c60e059c9e6e4048045b4ff42530a
treebd0f2c5c0cbefd28fe8640f1ca6515799941c9c3
parentadead1a93f472affa97c494ef19f2f492ee6f34a
fmt: don't pad strings with zeros

It's what the documentation says, and oddly it already behaves correctly
for right padding, not left. (We never pad with zeros on the right.)

Just don't do it.

Fixes #56486

Change-Id: I2465edea93c69084e33bee0d945d5a1b85e6cd14
Reviewed-on: https://go-review.googlesource.com/c/go/+/555776
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Rob Pike <r@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/fmt/fmt_test.go
src/fmt/print.go