]> Cypherpunks repositories - gostls13.git/commit
fmt: allow padding and minus flags at the same time
authorMitar <mitar.git@tnode.com>
Fri, 1 Mar 2024 23:43:04 +0000 (23:43 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 4 Mar 2024 17:31:55 +0000 (17:31 +0000)
commit6dfd7a543517db868ef4f31e91fe56aba5bc8ea0
treeb86347bf3a46ea096ec2677233403c3d7e4b5eb0
parent9853da523e72c91ab90b6b5d1ca0baa3fc646be4
fmt: allow padding and minus flags at the same time

Existing implementation did not allow setting both padding and minus flags at the same time because standard formatting does not allow that. But custom Formatter interface implementations might have use of it. This change moves the check from the place flags are parsed to where they are used in standard formatting.

Fixes #61784

Change-Id: If5909d45dc929ddf911453e1056a4661abe76e52
GitHub-Last-Rev: d99ec55d3bbd9b2a8f14c8ade2fb25d6e0c174c3
GitHub-Pull-Request: golang/go#61836
Reviewed-on: https://go-review.googlesource.com/c/go/+/516975
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Martin Möhrmann <moehrmann@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Martin Möhrmann <martin@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
src/fmt/fmt_test.go
src/fmt/format.go
src/fmt/print.go