Tired of debugging using fmt.Println and fmt.Printf("%+v", var). Use grok to print out a pretty formatted view of your variables and what's in them.
go get github.com/mertenvg/grok@latestgrok.V(myVar) // or grok.Value(myVar)
// or for customised output
grok.V(myVar, grok.WithMaxDepth(3), grok.WithTabStop(2))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) OptionThe following go types have their output abbreviated when nested within other structs. To see their un-abbreviated content simply grok.V that specific value.
time.Time
http.Request
http.ResponsePlease create an issue