From b8620afb8d17a2b884f20535ccbc21b192b75b3a Mon Sep 17 00:00:00 2001 From: mewmew Date: Thu, 29 Mar 2018 23:00:01 +0000 Subject: [PATCH] fmt: document the behaviour of %p on slices 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 --- src/fmt/doc.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fmt/doc.go b/src/fmt/doc.go index 375cdb4266..f3f2023dc2 100644 --- a/src/fmt/doc.go +++ b/src/fmt/doc.go @@ -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, -- 2.48.1