1
0
mirror of https://github.com/golang/go synced 2024-10-06 01:21:21 -06:00
go/src/fmt
Thorben Krueger 26fe24cbe2 fmt: Add support for capital '%X' format verb for scanning
For printing, the format verb '%X' results in a capitalized
hex-representation of the formatted value. Conversely, using
'%X' in a Scanf function should scan a hex-representation
into the given interface{}. The existing implementation
however only supports '%X' for scanning hex values into
integers; strings or byte slices remain empty. On the other
hand, lower-case '%x' supports strings and byte slices just
fine. This is merely an oversight, which this commit fixes.
(Additional tests also included.)

    Fixes #12940

Change-Id: I178a7f615bae950dfc014ca8c0a038448cf0452a
Reviewed-on: https://go-review.googlesource.com/15689
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-10-20 01:08:54 +00:00
..
doc.go fmt: clarify reflect.Value printing 2015-10-19 18:29:36 +00:00
export_test.go
fmt_test.go fmt: allow any type in a format's width argument 2015-09-10 20:53:22 +00:00
format.go fmt: restore padding for %x on byte slices and strings 2015-06-29 07:17:23 +00:00
norace_test.go fmt: skip malloc test under race detector 2015-05-11 17:45:26 +00:00
print.go fmt: allow any type in a format's width argument 2015-09-10 20:53:22 +00:00
race_test.go fmt: skip malloc test under race detector 2015-05-11 17:45:26 +00:00
scan_test.go fmt: Add support for capital '%X' format verb for scanning 2015-10-20 01:08:54 +00:00
scan.go fmt: Add support for capital '%X' format verb for scanning 2015-10-20 01:08:54 +00:00
stringer_test.go