Re: [go-nuts] defer with testify/assert

2016-10-14 Thread Kiki Sugiaman
Got it now, thanks~ -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/

Re: [go-nuts] defer with testify/assert

2016-10-14 Thread Jan Mercl
On Fri, Oct 14, 2016 at 4:19 PM Kiki Sugiaman wrote: > Maybe there's something I don't understand about defer. "inside dummyfunc" showing first is correct. The reason is Each time a "defer" statement executes, the function value and parameters to the call are evaluated as usual and saved a

[go-nuts] defer with testify/assert

2016-10-14 Thread Kiki Sugiaman
Suppose I have the following test file using the testify/assert framework (to be run with "go test"): https://play.golang.org/p/faJDJcI3MR Regardless of assert function's implementation details, shouldn't the output always be: inside main test goroutine foo inside dummyfunc ? But what I'm