]> Cypherpunks repositories - gostls13.git/commitdiff
fmt: document verbs %b %d %o %x %X for printing pointers
authorRob Pike <r@golang.org>
Mon, 28 Aug 2017 04:35:33 +0000 (14:35 +1000)
committerRob Pike <r@golang.org>
Mon, 28 Aug 2017 05:11:30 +0000 (05:11 +0000)
This has been supported since Go 1 and there's even a test for it.
The documentation was missing.

Fixes #21409.

Change-Id: I5813488f6a98c1b4506c239e968d43344b91be12
Reviewed-on: https://go-review.googlesource.com/59412
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/fmt/doc.go

index 014ba06948d42880b2add0ea85826b17fba0968d..d1ce8c41775d1df0428a4be7321c391e50d82183 100644 (file)
@@ -47,6 +47,8 @@
                %X      base 16, upper-case, two characters per byte
        Pointer:
                %p      base 16 notation, with leading 0x
+               The %b, %d, %o, %x and %X verbs also work with pointers,
+               formatting the value exactly as if it were an integer.
 
        The default format for %v is:
                bool:                    %t