Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

pretty

v1.51.4
github.com/lfch/grpc/internal/pretty

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

3 matches

Top ↑

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

Functions

FormatJSON

func FormatJSON(b []byte) string

FormatJSON formats the input json bytes with indentation.

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

ToJSON

func ToJSON(e interface{}) string

ToJSON marshals the input into a json string.

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

Dependency graph