output

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNoColor

func IsNoColor() bool

IsNoColor returns true when the NO_COLOR environment variable is set.

func Print

func Print(w io.Writer, data any, format string, fields string) error

Print formats data to the given writer in the specified format, optionally filtering fields. data: any JSON-serializable value (struct, map, slice). format: "json" | "table" | "csv". fields: comma-separated field names to include (empty string means all fields).

func PrintError

func PrintError(w io.Writer, err error) error

PrintError writes a structured JSON error to the given writer.

For *meta.GraphError: includes message, code, subcode, trace_id, and — when Meta provided them — user_title and user_message (surfaced from error_user_title / error_user_msg). These are the developer-facing explanations Meta writes to describe what went wrong and how to fix it, so they are rendered as first-class fields on our error shape.

For other errors: includes message only.

The new user_title / user_message keys are additive and omitted when empty, so existing consumers that only read message/code/subcode/trace_id see no shape change.

Types

This section is empty.

Jump to

Keyboard shortcuts

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