From d39f5aa373a4422f7a5f3ee764fb0f6b0b719d61 Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Thu, 30 Jun 2011 15:34:22 +0200 Subject: Imported Upstream version 58 --- src/pkg/fmt/format.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/pkg/fmt/format.go') diff --git a/src/pkg/fmt/format.go b/src/pkg/fmt/format.go index f9d2b4fca..5dcfb9677 100644 --- a/src/pkg/fmt/format.go +++ b/src/pkg/fmt/format.go @@ -296,6 +296,13 @@ func (f *fmt) fmt_q(s string) { f.padString(quoted) } +// fmt_qc formats the integer as a single-quoted, escaped Go character constant. +// If the character is not valid Unicode, it will print '\ufffd'. +func (f *fmt) fmt_qc(c int64) { + quoted := strconv.QuoteRune(int(c)) + f.padString(quoted) +} + // floating-point func doPrec(f *fmt, def int) int { -- cgit v1.2.3