From: Sean Liao Date: Sat, 6 Aug 2022 13:28:16 +0000 (+0100) Subject: encoding/pem: clarify Decode only works on lines X-Git-Tag: go1.25rc1~830 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2e6cbab1c84363638ed48f259c3db57c4d2aaab3;p=gostls13.git encoding/pem: clarify Decode only works on lines Fixes #53524 Change-Id: I929ee3c055c3ca564cd6cc374124f493aea2fbf6 Reviewed-on: https://go-review.googlesource.com/c/go/+/421636 Reviewed-by: Ian Lance Taylor Reviewed-by: Junyang Shao LUCI-TryBot-Result: Go LUCI Auto-Submit: Ian Lance Taylor --- diff --git a/src/encoding/pem/pem.go b/src/encoding/pem/pem.go index 7a515fd363..dcc7416ee2 100644 --- a/src/encoding/pem/pem.go +++ b/src/encoding/pem/pem.go @@ -85,7 +85,7 @@ var colon = []byte(":") // Decode will find the next PEM formatted block (certificate, private key // etc) in the input. It returns that block and the remainder of the input. If // no PEM data is found, p is nil and the whole of the input is returned in -// rest. +// rest. Blocks must start at the beginning of a line and end at the end of a line. func Decode(data []byte) (p *Block, rest []byte) { // pemStart begins with a newline. However, at the very beginning of // the byte array, we'll accept the start string without it.