// writeGoogleData writes the contents of the message file with maintain the coding
// system. At the moment only implemented quoted-printable and base64 encoding.
// For all others, an error is returned.
writeGoogleData writes the contents of the message file with maintain the coding
system. At the moment only implemented quoted-printable and base64 encoding.
For all others, an error is returned.
// writeGoogleData writes the contents of the message file with maintain the coding // system . At the moment only implemented quoted - printable and base64 encoding . // For all others an error is returned .
func (p *GooglePart) writeGoogleData(w io.Writer) (numBytes int, err error) {
	switch name := p.Header.Get("Content-Transfer-Encoding"); name {
	case "quoted-printable":
		enc := quotedprintable.NewWriter(w)
		numBytes, err = enc.Write(p.Data)
		enc.Close()
	case "base64":
		enc := base64.NewEncoder(base64.StdEncoding, w)
		numBytes, err = enc.Write(p.Data)
		enc.Close()
	default:
		err = fmt.Errorf("unsupported transform encoding: %v", name)
	}
	return numBytes, err
}
func ( p * GooglePart ) writeGoogleData ( w io . Writer ) ( numBytes int , err error ) { switch name := p . Header . Get ( " " ) ; name { case " " : enc := quotedprintable . NewWriter ( w ) numBytes , err = enc . Write ( p . Data ) enc . Close ( ) case " " : enc := base64 . NewEncoder ( base64 . StdEncoding , w ) numBytes , err = enc . Write ( p . Data ) enc . Close ( ) default : err = fmt . Errorf ( " " , name ) } return numBytes , err }
writeGoogleData writes the contents of the message file with maintain the coding
system.
writeGoogleData writes the contents of the message file with maintain the coding system .