pretty

package
v0.0.0-...-0f280f2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(mimeType string, body []byte, w io.Writer) error

Print detects format and pretty-prints body to w. Returns error if format is unknown or body fails to parse.

Types

type Format

type Format int

Format represents a detected content format.

const (
	FormatUnknown Format = iota
	FormatJSON
	FormatXML
	FormatHTML
	FormatYAML
	FormatURLEncoded
	FormatMultipart
)

func Detect

func Detect(mimeType string, body []byte) Format

Detect returns format from MIME type, falling back to content sniffing.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL