]> Cypherpunks repositories - gostls13.git/commitdiff
fmt: document the behaviour of %p on slices
authormewmew <rnd0x00@gmail.com>
Thu, 29 Mar 2018 23:00:01 +0000 (23:00 +0000)
committerRob Pike <r@golang.org>
Fri, 30 Mar 2018 00:19:36 +0000 (00:19 +0000)
Fixes #23291.

Change-Id: I9bb3b8246968693871d4800e2cdb2c8390f4b6a6
GitHub-Last-Rev: bc3444206764016b730d770a8c71a49c214ae824
GitHub-Pull-Request: golang/go#24600
Reviewed-on: https://go-review.googlesource.com/103516
Reviewed-by: Rob Pike <r@golang.org>
src/fmt/doc.go

index 375cdb4266db63e9cf7033535d1fd9a97fdaf48c..f3f2023dc2116bc124d7841785bb14315342f686 100644 (file)
@@ -45,6 +45,8 @@
                %q      a double-quoted string safely escaped with Go syntax
                %x      base 16, lower-case, two characters per byte
                %X      base 16, upper-case, two characters per byte
+       Slice:
+               %p      address of 0th element in base 16 notation, with leading 0x
        Pointer:
                %p      base 16 notation, with leading 0x
                The %b, %d, %o, %x and %X verbs also work with pointers,