This commit is contained in:
emersion 2017-08-06 18:58:18 +02:00
parent d579059ccf
commit 360f954626
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
3 changed files with 13 additions and 13 deletions

View File

@ -27,7 +27,7 @@ func ExampleEncrypt() {
th.SetContentType("text/plain", nil) th.SetContentType("text/plain", nil)
// Create a new PGP/MIME writer // Create a new PGP/MIME writer
var ciphertext struct{*message.Writer} var ciphertext struct{ *message.Writer }
cleartext := pgpmime.Encrypt(&ciphertext, textproto.MIMEHeader(th.Header), to, nil, nil) cleartext := pgpmime.Encrypt(&ciphertext, textproto.MIMEHeader(th.Header), to, nil, nil)
// Add the PGP/MIME Content-Type header field to the mail header // Add the PGP/MIME Content-Type header field to the mail header
@ -73,7 +73,7 @@ func ExampleSign() {
bh := mail.NewTextHeader() bh := mail.NewTextHeader()
bh.SetContentType("text/plain", nil) bh.SetContentType("text/plain", nil)
var signed struct{*message.Writer} var signed struct{ *message.Writer }
body := pgpmime.Sign(&signed, textproto.MIMEHeader(bh.Header), e, nil) body := pgpmime.Sign(&signed, textproto.MIMEHeader(bh.Header), e, nil)
mh.Set("Content-Type", body.ContentType()) mh.Set("Content-Type", body.ContentType())

View File

@ -2,11 +2,11 @@ package pgpmime
import ( import (
"bytes" "bytes"
"crypto"
"io" "io"
"mime" "mime"
"mime/multipart" "mime/multipart"
"net/textproto" "net/textproto"
"crypto"
"golang.org/x/crypto/openpgp" "golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/packet" "golang.org/x/crypto/openpgp/packet"
@ -59,7 +59,7 @@ func (sw *signWriter) open() error {
ch <- &b ch <- &b
}() }()
sw.body = struct{ sw.body = struct {
io.Writer io.Writer
io.Closer io.Closer
}{ }{