Tired of debugging using the same old fmt.Println
and fmt.Printf("%+v", var)
. Enter grok
! A new package to help you grok your own code.
go get github.com/bookerzzz/grok
import "github.com/bookerzzz/grok"
fake := "News"
grok.Value(fake) // or grok.V(fake)
// or for customised output
grok.Value(fake, ...grok.Option)
The grok package comes with the following customisation options baked in:
// WithWriter redirects output from debug functions to the given io.Writer
func WithWriter(w io.Writer) Option
// WithoutColours disables colouring of output from debug functions. Defaults to `true`
func WithoutColours() Option
// WithMaxDepth sets the maximum recursion depth from debug functions. Defaults to `10`, use `0` for unlimited
func WithMaxDepth(depth int) Option
// WithMaxLength sets the maximum length of string values. Default is `100`, use `0` for unlimited
func WithMaxLength(chars int) Option
// WithTabStop sets the width of a tabstop to the given char count. Defaults to `4`
func WithTabStop(chars int) Option
Please create an issue