Standard library / mime/quotedprintable
quotedprintable.NewWriter()
Wrap a destination with a quoted-printable encoder. Close the encoder to flush pending bytes. Expected stdout: 'caf=C3=A9\n'.
Formal Syntax & Structure
go syntaxgo
func NewWriter(w io.Writer) *WriterParameters & Attributes
| Name | Type | Description |
|---|---|---|
| w | io.Writer | Underlying destination stream. |
Return Value
*Writer
Writer wrapping the destination.
Working Example
Example Snippetgo
package main
import ( "bytes" "fmt" "io" "mime/quotedprintable")
func main() { var b bytes.Buffer w := quotedprintable.NewWriter(&b) must(io.WriteString(w, "café")) check(w.Close()) fmt.Println(b.String())}
func must[T any](v T, e error) T { if e != nil { panic(e) } return v}func check(e error) { if e != nil { panic(e) }}