Standard library / mime/quotedprintable
quotedprintable.Writer
Streaming quoted-printable encoder. Binary controls whether line endings are encoded as bytes rather than normalized as text. Expected stdout: 'a=0Ab\n'.
Formal Syntax & Structure
go syntaxgo
type Writer struct { Binary bool
}Working Example
Example Snippetgo
package main
import ( "bytes" "fmt" "mime/quotedprintable")
func main() { var b bytes.Buffer w := quotedprintable.NewWriter(&b) w.Binary = true must(w.Write([]byte("a\nb"))) 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) }}