Standard library / mime

mime.ErrInvalidMediaParameter

Sentinel for a recognized media type followed by invalid parameters. Reject or explicitly handle the partial parse. Expected stdout: 'text/plain true\n'.

Formal Syntax & Structure

go syntaxgo
var ErrInvalidMediaParameter error

Working Example

Example Snippetgo
package main
import (  "errors"  "fmt"  "mime")
func main() {  t, _, e := mime.ParseMediaType("text/plain; broken")  fmt.Println(t, errors.Is(e, mime.ErrInvalidMediaParameter))}
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