Standard library / mime/multipart

multipart.Reader.NextRawPart()

Return the next part without the quoted-printable decoding performed by NextPart. Expected stdout: 'a=3Db quoted-printable\n'.

Formal Syntax & Structure

go syntaxgo
func (r *Reader) NextRawPart() (*Part, error)

Return Value

(*Part, error)

Next part without automatic quoted-printable decoding, or error.

Working Example

Example Snippetgo
package main
import (  "fmt"  "io"  "mime/multipart"  "strings")
func main() {  r := multipart.NewReader(strings.NewReader("--demo\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\na=3Db\r\n--demo--\r\n"), "demo")  p := must(r.NextRawPart())  fmt.Println(string(must(io.ReadAll(p))), p.Header.Get("Content-Transfer-Encoding"))}
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)  }}
Go Reference