1
0
mirror of https://github.com/golang/go synced 2024-09-24 09:20:15 -06:00
go/src
Todd Neal 4e834cff4f fmt: handle negative width/prec when supplied as an argument
Negative width arguments now left align the way a minus-width in the
format string aligns. The minus in the format string overrides the sign
of the argument as in C.

Precision behavior is modified to include an error if the argument is
negative.  This differs from a negative precision in a format string
which just terminates the format.

Additional checks for large magnitude widths and precisions are added to
make the runtime behavior (failure, but with different error messages),
more consistent between format string specified width/precision and
argument specified width/precision.

Fixes #11376

Change-Id: I8c7ed21088e9c18128a45d4c487c5ab9fafd13ef
Reviewed-on: https://go-review.googlesource.com/11405
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Rob Pike <r@golang.org>
2015-06-25 05:34:02 +00:00
..
archive all: switch to the new deprecation convention 2015-06-18 19:16:23 +00:00
bufio
builtin
bytes bytes, strings: add LastIndexByte 2015-04-30 07:13:18 +00:00
cmd cmd/compile/internal/gc: make sure nonzero-sized objects have nonzero alignment 2015-06-25 02:22:58 +00:00
compress compress/lzw: reject writing bytes that don't fit into litWidth. 2015-06-18 22:17:11 +00:00
container
crypto all: extract "can I exec?" check from tests into internal/testenv 2015-06-16 18:07:36 +00:00
database/sql database/sql: refer correct issue in TestErrBadConnReconnect comment 2015-06-06 02:17:49 +00:00
debug all: fix misprints in comments 2015-06-11 14:18:57 +00:00
encoding encoding/csv: add examples for package 2015-06-22 11:11:37 +00:00
errors
expvar
flag flag: Describe the ErrorHandling enum values. 2015-06-05 13:53:26 +00:00
fmt fmt: handle negative width/prec when supplied as an argument 2015-06-25 05:34:02 +00:00
go go/format: fix //line corner case when formatting statements 2015-06-24 21:45:49 +00:00
hash hash/crc32: speedup crc32 of IEEE using slicingBy8 2015-06-18 18:14:24 +00:00
html html: add examples to the functions 2015-06-19 05:15:22 +00:00
image image/gif: set default loop count to 0 when app ext. is not present 2015-06-23 05:50:50 +00:00
index/suffixarray
internal go/format: fix //line corner case when formatting statements 2015-06-24 21:45:49 +00:00
io io: minor improvements to doc comment on WriteString. 2015-05-29 04:33:15 +00:00
log log: fix flaky test 2015-06-18 18:08:17 +00:00
math math/big: fix GCD in presence of aliasing 2015-06-19 19:53:45 +00:00
mime mime: add mime.types paths for BSDs 2015-06-12 15:51:21 +00:00
net net/http: sync Get and Head's documentation 2015-06-25 05:07:40 +00:00
os os: fix nits found by vet 2015-06-19 00:44:13 +00:00
path path: fix a typo in documentation of Split 2015-05-31 22:08:38 +00:00
reflect runtime: use type-based write barrier for remote stack write during chansend 2015-06-15 16:50:30 +00:00
regexp regexp: small correction to test comment 2015-06-14 17:09:13 +00:00
runtime runtime: set m.procid always on Linux 2015-06-24 21:50:39 +00:00
sort
strconv strconv: minor internal comment fix 2015-05-27 22:02:02 +00:00
strings strings: mention UTF-8 in the package comment. 2015-06-03 19:28:41 +00:00
sync all: use RET instead of RETURN on ppc64 2015-06-06 00:07:23 +00:00
syscall syscall: skip non-root user namespace test if kernel forbids 2015-06-20 00:52:38 +00:00
testing testing: don't print CPU count for tests, only benchmarks 2015-06-15 18:11:06 +00:00
text text/template: make zero Template work again 2015-06-24 22:27:33 +00:00
time time: correct unrepresentable Unix time comment 2015-06-18 18:21:59 +00:00
unicode
unsafe
all.bash
all.bat
all.rc
androidtest.bash androidtest.bash: clean up stale GOROOT 2015-05-25 20:53:26 +00:00
bootstrap.bash
buildall.bash buildall.bash: exit 1 when make.bash fails 2015-05-17 01:40:33 +00:00
clean.bash build: fix clean scripts 2015-06-18 16:13:13 +00:00
clean.bat build: fix clean scripts 2015-06-18 16:13:13 +00:00
clean.rc build: fix clean scripts 2015-06-18 16:13:13 +00:00
iostest.bash
make.bash doc: replace references to {5..9}{g,l} with go tool compile and go tool link 2015-06-17 04:05:50 +00:00
make.bat doc: replace references to {5..9}{g,l} with go tool compile and go tool link 2015-06-17 04:05:50 +00:00
Make.dist
make.rc doc: replace references to {5..9}{g,l} with go tool compile and go tool link 2015-06-17 04:05:50 +00:00
nacltest.bash nacltest.bash: remove syscall/fstest_nacl.go after test 2015-05-02 02:48:32 +00:00
race.bash cmd/dist: move guts of race.bash into dist 2015-06-09 05:22:37 +00:00
race.bat cmd/dist: move guts of race.bash into dist 2015-06-09 05:22:37 +00:00
run.bash build: correct quoting of args in run.bash 2015-05-09 04:23:47 +00:00
run.bat
run.rc