debug

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 2 Imported by: 0

README

debug

Go Go Version GoDoc codecov Go Report Card tests MIT license

Installation

go get github.com/go-packagist/debug

Usage

package main

import (
	"github.com/go-packagist/debug"
	"os"
)

func main() {
	debug.Dump("hello world", []byte("hello world"), 123, 123.456, true, nil)
	debug.Sdump("hello world: %s", "Lily")
	debug.Fdump(os.Stdout, "hello world")

	// Output:
	// (string) (len=11) "hello world"
	// ([]uint8) (len=11 cap=11) {
	// 	00000000  68 65 6c 6c 6f 20 77 6f  72 6c 64                 |hello world|
	// }
	// (int) 123
	// (float64) 123.456
	// (bool) true
	// (interface {}) <nil>
	// (string) (len=11) "hello world"
}

License

  • The MIT License (MIT). Please see License File for more information.
  • Thanks to go-spew for the inspiration.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dump

func Dump(v ...interface{})

Dump dumps the given values. It is a wrapper for spew.Dump(https://github.com/davecgh/go-spew) This is useful for debugging.

func Fdump

func Fdump(w io.Writer, v ...interface{})

Fdump the given values to the given writer. It's a wrapper for spew.Fdump(https://github.com/davecgh/go-spew) This is useful for debugging.

func Sdump

func Sdump(v ...interface{}) string

Sdump the given values and returns the result. It's a wrapper for spew.Sdump(https://github.com/davecgh/go-spew) This is useful for debugging.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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