diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-06-03 11:31:24 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-06-03 11:31:24 +0200 |
commit | 56135c623a865c501ab31cc940c0e22ece2673f4 (patch) | |
tree | f69e04e82bbf75bdab0f624430ef265425e62b35 /src/pkg/fmt/format.go | |
parent | 63d29fefab5290dc96e0a03ff70603aefa995887 (diff) | |
download | golang-56135c623a865c501ab31cc940c0e22ece2673f4.tar.gz |
Imported Upstream version 2011.06.02upstream-weekly/2011.06.02
Diffstat (limited to 'src/pkg/fmt/format.go')
-rw-r--r-- | src/pkg/fmt/format.go | 7 |
1 files changed, 7 insertions, 0 deletions
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 { |