Skip to content

Commit b8620af

Browse files
mewmewrobpike
authored andcommitted
fmt: document the behaviour of %p on slices
Fixes #23291. Change-Id: I9bb3b8246968693871d4800e2cdb2c8390f4b6a6 GitHub-Last-Rev: bc34442 GitHub-Pull-Request: #24600 Reviewed-on: https://go-review.googlesource.com/103516 Reviewed-by: Rob Pike <[email protected]>
1 parent 72b0fb5 commit b8620af

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/fmt/doc.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
%q a double-quoted string safely escaped with Go syntax
4646
%x base 16, lower-case, two characters per byte
4747
%X base 16, upper-case, two characters per byte
48+
Slice:
49+
%p address of 0th element in base 16 notation, with leading 0x
4850
Pointer:
4951
%p base 16 notation, with leading 0x
5052
The %b, %d, %o, %x and %X verbs also work with pointers,

0 commit comments

Comments
 (0)