Example #1
0
// FdumpExpr dumps goon expressions to a writer.
func FdumpExpr(w io.Writer, a ...interface{}) (n int, err error) {
	names := reflectsource.GetParentArgExprAllAsString()
	if len(names) >= 1 {
		names = names[1:] // First argument is the writer, skip it.
	}
	return w.Write(bdumpNamed(names, a...))
}
Example #2
0
// SdumpExpr dumps goon expressions to a string.
func SdumpExpr(a ...interface{}) string {
	return string(bdumpNamed(reflectsource.GetParentArgExprAllAsString(), a...))
}
Example #3
0
// DumpExpr dumps goon expressions to stdout.
//
// E.g., this:
//
// 	somethingImportant := 5
// 	DumpExpr(somethingImportant)
//
// Will print:
//
// 	somethingImportant = (int)(5)
func DumpExpr(a ...interface{}) (n int, err error) {
	return os.Stdout.Write(bdumpNamed(reflectsource.GetParentArgExprAllAsString(), a...))
}