mirror of
https://github.com/golang/go
synced 2024-11-22 01:14:40 -07:00
pem: print \n after 1 header line too
rearrange to make reason for if clear. Fixes #911. R=agl1 CC=golang-dev https://golang.org/cl/1774044
This commit is contained in:
parent
ccd28e8eb6
commit
36560d2b4a
@ -218,14 +218,13 @@ func Encode(out io.Writer, b *Block) (err os.Error) {
|
||||
return
|
||||
}
|
||||
|
||||
for k, v := range b.Headers {
|
||||
_, err = out.Write([]byte(k + ": " + v + "\n"))
|
||||
if err != nil {
|
||||
return
|
||||
if len(b.Headers) > 0 {
|
||||
for k, v := range b.Headers {
|
||||
_, err = out.Write([]byte(k + ": " + v + "\n"))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(b.Headers) > 1 {
|
||||
_, err = out.Write([]byte{'\n'})
|
||||
if err != nil {
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user