pretty

package
v2.0.16 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 4 Imported by: 31

Documentation

Overview

Package pretty defines helper functions to pretty-print structs for logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatJSON

func FormatJSON(b []byte) string

FormatJSON formats the input json bytes with indentation.

If Indent fails, it returns the unchanged input as string.

func MustToYaml

func MustToYaml(v any) string

func ToJSON

func ToJSON(e interface{}) string

ToJSON marshals the input into a json string.

If marshal fails, it falls back to fmt.Sprintf("%+v").

Types

This section is empty.

Jump to

Keyboard shortcuts

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