debug

package module
v0.0.0-...-5cc2ac0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 5 Imported by: 0

README

debug

GetSpew

import (
    "github.com/northwood-labs/golang-utils/debug"
    "github.com/northwood-labs/golang-utils/exiterrorf"
)

func main() {
    var results map[string]interface{}

    // Do some stuff to a variable.
    err := json.Unmarshal(data, &results)
    if err != nil {
        exiterrorf.ExitErrorf(err)
    }

    // Pretty-print the contents of the variable.
    pp := debug.GetSpew()
    pp.Dump(results)
}

Spew is a library that can print the contents of a data structure, much like PrettyPrint in Python, or print_r() or var_dump() in PHP. This implementation provides a specific configuration for Spew that is repeatable.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSpew

func GetSpew() spew.ConfigState

GetSpew is analogous to PrettyPrint in Python or print_r() in PHP.

func Vardump

func Vardump(varname string, args ...interface{})

Vardump prints the name of the variable and dumps its contents.

Types

This section is empty.

Jump to

Keyboard shortcuts

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