diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-09-13 13:13:44 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-09-13 13:13:44 +0200 |
commit | 9464a0c36318f8a801c07d6874bd0cea40f12504 (patch) | |
tree | f0178491c19d4f1ebc7b92eede86690998466480 /src/pkg/fmt/format.go | |
parent | ba9fda6068cfadd42db0b152fdca7e8b67aaf77d (diff) | |
parent | 5ff4c17907d5b19510a62e08fd8d3b11e62b431d (diff) | |
download | golang-9464a0c36318f8a801c07d6874bd0cea40f12504.tar.gz |
Merge commit 'upstream/60' into debian-sid
Diffstat (limited to 'src/pkg/fmt/format.go')
-rw-r--r-- | src/pkg/fmt/format.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pkg/fmt/format.go b/src/pkg/fmt/format.go index bec55f75b..24b15a286 100644 --- a/src/pkg/fmt/format.go +++ b/src/pkg/fmt/format.go @@ -166,6 +166,11 @@ func (f *fmt) fmt_boolean(v bool) { // integer; interprets prec but not wid. Once formatted, result is sent to pad() // and then flags are cleared. func (f *fmt) integer(a int64, base uint64, signedness bool, digits string) { + // precision of 0 and value of 0 means "print nothing" + if f.precPresent && f.prec == 0 && a == 0 { + return + } + var buf []byte = f.intbuf[0:] negative := signedness == signed && a < 0 if negative { |