I'm brand new to Go and trying to inspect a method argument. I've got the following code
func (c *controller) OrderNew(ctx echo.Context) error {
When I try either:
fmt.println(ctx)
fmt.Printf("%v \n", ctx)
I get
&{0xc4200f21e0 0xc4202302d0 /order [] [] map[] 0x4092860 map[site_key:2] 0xc4200bb6c0}
I realize *controller is a pointer and the values returned contain addresses, but not sure how to really debug or inspect further. I also see functions called on cxt like
ctx.Get and ctx.Render
which I realize are functions in echo.Context
Any help/clarification is appreciated. Thanks!
use log package.
log.Printf("CONTEXT %+v", ctx)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With