1
0
mirror of https://github.com/golang/go synced 2024-11-19 21:24:40 -07:00
go/src/encoding/pem
Russ Cox c3fa046f54 encoding/pem: change Encode, EncodeToMemory not to generate partial PEM blocks
Originally these routines could not fail except by
returning errors from the underlying writer.

Then we realized that header keys containing colons
needed to be rejected, and we started returning an error
from Encode. But that only happens after writing a
partial PEM block to the underlying writer, which is
unfortunate, but at least it was undocumented.

CL 77790 then documented this unfortunate behavior.

Instead of documenting unfortunate behavior, fix it.

Change-Id: Ic7467a576c4cecd16a99138571a1269cc4f96204
Reviewed-on: https://go-review.googlesource.com/82076
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-06 03:59:41 +00:00
..
example_test.go encoding/pem: add Encode example 2017-11-15 03:08:55 +00:00
pem_test.go encoding/pem: change Encode, EncodeToMemory not to generate partial PEM blocks 2017-12-06 03:59:41 +00:00
pem.go encoding/pem: change Encode, EncodeToMemory not to generate partial PEM blocks 2017-12-06 03:59:41 +00:00