debug

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Enabled = false

Variables

This section is empty.

Functions

func Assert

func Assert(bool, string, ...any)

func Log

func Log([]any, string, string, ...any)

func Stack

func Stack(skip int) string

Stack is like runtime/debug.Stack, but with a skip parameter and an easier to read format.

func Unsupported

func Unsupported() error

Unsupported returns "unimplemented" error for the calling function.

func WithTesting

func WithTesting(t testing.TB) func()

WithTesting sets a testing pointer for debugging.

This will cause t.Log() to be used to print debug traces instead of Debug.

Types

type Formatter

type Formatter func(s fmt.State)

Formatter is a fmt.Formatter implementation that just calls a function.

func Dict

func Dict(prefix any, kv ...any) Formatter

Dict pretty-prints the given entries as a dictionary, with an optional prefix.

func Fprintf

func Fprintf(format string, args ...any) Formatter

Fprintf is like Fprintf, but the printing is delayed until the returned value is formatted with %v.

func Func

func Func(f any) Formatter

Func pretty-prints a function value.

func (Formatter) Format

func (f Formatter) Format(s fmt.State, verb rune)

func (Formatter) String

func (f Formatter) String() string

type Value

type Value[T any] struct {
	// contains filtered or unexported fields
}

func (*Value[T]) Get

func (v *Value[T]) Get() *T

Jump to

Keyboard shortcuts

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