logStack prints the formatted "start" message to stderr and returns a closure that prints the corresponding "end" message. Call using 'defer logStack(...)()' to show builder stack on panic. Don't forget trailing parens!
(format string, args ...interface{})
| 47 | // Don't forget trailing parens! |
| 48 | // |
| 49 | func logStack(format string, args ...interface{}) func() { |
| 50 | msg := fmt.Sprintf(format, args...) |
| 51 | io.WriteString(os.Stderr, msg) |
| 52 | io.WriteString(os.Stderr, "\n") |
| 53 | return func() { |
| 54 | io.WriteString(os.Stderr, msg) |
| 55 | io.WriteString(os.Stderr, " end\n") |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | // newVar creates a 'var' for use in a types.Tuple. |
| 60 | func newVar(name string, typ Type) *Var { |
no outgoing calls
no test coverage detected