diff options
author | Ian Lance Taylor <iant@golang.org> | 2018-09-24 21:46:21 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-09-24 21:46:21 +0000 |
commit | dd931d9b48647e898dc80927c532ae93cc09e192 (patch) | |
tree | 71be2295cd79b8a182f6130611658db8628772d5 /libgo/go/fmt/format.go | |
parent | 779d8a5ad09b01428726ea5a0e6c87bd9ac3c0e4 (diff) | |
download | gcc-dd931d9b48647e898dc80927c532ae93cc09e192.zip gcc-dd931d9b48647e898dc80927c532ae93cc09e192.tar.gz gcc-dd931d9b48647e898dc80927c532ae93cc09e192.tar.bz2 |
libgo: update to Go 1.11
Reviewed-on: https://go-review.googlesource.com/136435
gotools/:
* Makefile.am (mostlyclean-local): Run chmod on check-go-dir to
make sure it is writable.
(check-go-tools): Likewise.
(check-vet): Copy internal/objabi to check-vet-dir.
* Makefile.in: Rebuild.
From-SVN: r264546
Diffstat (limited to 'libgo/go/fmt/format.go')
-rw-r--r-- | libgo/go/fmt/format.go | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/libgo/go/fmt/format.go b/libgo/go/fmt/format.go index d4b92f8..91103f2 100644 --- a/libgo/go/fmt/format.go +++ b/libgo/go/fmt/format.go @@ -122,8 +122,8 @@ func (f *fmt) padString(s string) { } } -// fmt_boolean formats a boolean. -func (f *fmt) fmt_boolean(v bool) { +// fmtBoolean formats a boolean. +func (f *fmt) fmtBoolean(v bool) { if v { f.padString("true") } else { @@ -131,8 +131,8 @@ func (f *fmt) fmt_boolean(v bool) { } } -// fmt_unicode formats a uint64 as "U+0078" or with f.sharp set as "U+0078 'x'". -func (f *fmt) fmt_unicode(u uint64) { +// fmtUnicode formats a uint64 as "U+0078" or with f.sharp set as "U+0078 'x'". +func (f *fmt) fmtUnicode(u uint64) { buf := f.intbuf[0:] // With default precision set the maximum needed buf length is 18 @@ -190,8 +190,8 @@ func (f *fmt) fmt_unicode(u uint64) { f.zero = oldZero } -// fmt_integer formats signed and unsigned integers. -func (f *fmt) fmt_integer(u uint64, base int, isSigned bool, digits string) { +// fmtInteger formats signed and unsigned integers. +func (f *fmt) fmtInteger(u uint64, base int, isSigned bool, digits string) { negative := isSigned && int64(u) < 0 if negative { u = -u @@ -322,14 +322,14 @@ func (f *fmt) truncate(s string) string { return s } -// fmt_s formats a string. -func (f *fmt) fmt_s(s string) { +// fmtS formats a string. +func (f *fmt) fmtS(s string) { s = f.truncate(s) f.padString(s) } -// fmt_sbx formats a string or byte slice as a hexadecimal encoding of its bytes. -func (f *fmt) fmt_sbx(s string, b []byte, digits string) { +// fmtSbx formats a string or byte slice as a hexadecimal encoding of its bytes. +func (f *fmt) fmtSbx(s string, b []byte, digits string) { length := len(b) if b == nil { // No byte slice present. Assume string s should be encoded. @@ -394,20 +394,20 @@ func (f *fmt) fmt_sbx(s string, b []byte, digits string) { } } -// fmt_sx formats a string as a hexadecimal encoding of its bytes. -func (f *fmt) fmt_sx(s, digits string) { - f.fmt_sbx(s, nil, digits) +// fmtSx formats a string as a hexadecimal encoding of its bytes. +func (f *fmt) fmtSx(s, digits string) { + f.fmtSbx(s, nil, digits) } -// fmt_bx formats a byte slice as a hexadecimal encoding of its bytes. -func (f *fmt) fmt_bx(b []byte, digits string) { - f.fmt_sbx("", b, digits) +// fmtBx formats a byte slice as a hexadecimal encoding of its bytes. +func (f *fmt) fmtBx(b []byte, digits string) { + f.fmtSbx("", b, digits) } -// fmt_q formats a string as a double-quoted, escaped Go string constant. +// fmtQ formats a string as a double-quoted, escaped Go string constant. // If f.sharp is set a raw (backquoted) string may be returned instead // if the string does not contain any control characters other than tab. -func (f *fmt) fmt_q(s string) { +func (f *fmt) fmtQ(s string) { s = f.truncate(s) if f.sharp && strconv.CanBackquote(s) { f.padString("`" + s + "`") @@ -421,9 +421,9 @@ func (f *fmt) fmt_q(s string) { } } -// fmt_c formats an integer as a Unicode character. +// fmtC formats an integer as a Unicode character. // If the character is not valid Unicode, it will print '\ufffd'. -func (f *fmt) fmt_c(c uint64) { +func (f *fmt) fmtC(c uint64) { r := rune(c) if c > utf8.MaxRune { r = utf8.RuneError @@ -433,9 +433,9 @@ func (f *fmt) fmt_c(c uint64) { f.pad(buf[:w]) } -// fmt_qc formats an integer as a single-quoted, escaped Go character constant. +// fmtQc formats an 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 uint64) { +func (f *fmt) fmtQc(c uint64) { r := rune(c) if c > utf8.MaxRune { r = utf8.RuneError @@ -448,9 +448,9 @@ func (f *fmt) fmt_qc(c uint64) { } } -// fmt_float formats a float64. It assumes that verb is a valid format specifier +// fmtFloat formats a float64. It assumes that verb is a valid format specifier // for strconv.AppendFloat and therefore fits into a byte. -func (f *fmt) fmt_float(v float64, size int, verb rune, prec int) { +func (f *fmt) fmtFloat(v float64, size int, verb rune, prec int) { // Explicit precision in format specifier overrules default precision. if f.precPresent { prec = f.prec |