litter – github.com/sanity-io/litter Index | Files

package litter

import "github.com/sanity-io/litter"

Index

Variables

var Config = Options{
	StripPackageNames: false,
	HidePrivateFields: true,
	Separator:         " ",
}

Config is the default config used when calling Dump

Functions

func Dump

func Dump(value interface{})

Dump a value to stdout

func MapReusedPointers

func MapReusedPointers(v reflect.Value) []uintptr

MapReusedPointers : Given a structure, it will recurively map all pointers mentioned in the tree, breaking circular references and provide a list of all pointers that was referenced at least twice by the provided structure.

func Sdump

func Sdump(value interface{}) string

Sdump dumps a value to a string

Types

type Dumper

type Dumper interface {
	Dump(w io.Writer)
}

Dumper is the interface for implementing custom dumper for your types.

type Options

type Options struct {
	StripPackageNames bool
	HidePrivateFields bool
	HomePackage       string
	Separator         string
}

Options represents configuration options for litter

func (Options) Dump

func (o Options) Dump(values ...interface{})

Dump a value to stdout according to the options

func (Options) Sdump

func (o Options) Sdump(values ...interface{}) string

Sdump dumps a value to a string according to the options

Source Files

dump.go mapper.go print.go util.go

Version
v1.0.0
Published
Oct 29, 2017
Platform
js/wasm
Imports
9 packages
Last checked
11 seconds ago

Tools for package owners.