2022-01-02 17:46:18 +01:00

22 lines
264 B
Go

/*
Debug tools
debug.Dump(myStruct)
*/
package debug
import (
"encoding/json"
)
/*
Dump an interface to the stdout
*/
func Dump(v interface{}) string {
result, err := json.MarshalIndent(v, "", " ")
if err != nil {
return ""
}
return string(result)
}