Go author has their own ideal. 

Writing Go should be simple without too much 3rd party lib that can make 
mini-language inside Go language. 

It's up to you if you want to adopt. But the Wiki 
https://github.com/golang/go/wiki/TestComments is a good place to consider 
how you write better code and simple code.  


On Thursday, January 13, 2022 at 5:59:45 AM UTC+7 romenig...@gmail.com 
wrote:

> Hello!
>
> Recently I learn the page TestComments 
> <https://github.com/golang/go/wiki/TestComments> on Golang Wiki (on 
> Github).
>
> The section about Assert Libraries 
> <https://github.com/golang/go/wiki/TestComments#assert-libraries> discourage 
> the use of them.
>
> But I guess there's a little bit mistake in this approach because we have 
> good libraries that provide assert functions.
>
> The argument *omits interesting information about what the test got right* is 
> not the real true, is more easy to understand what the test does with 2 or 
> 3 asserts than a if with 2 or 3 ORs inline. Furthermore libraries as 
> Testify <https://github.com/stretchr/testify> provide rich and 
> easy-readable informations when the test fails in the assert functions.
>
> Finally, using asserts or ifs don't guarantee that the test is right, the 
> argument *Assert libraries make it too easy to write imprecise tests* is 
> more about the quality of test than the use of an assert library.
>
> Any thoughts?
>
> (I tried to create an issue on Github 
> <https://github.com/golang/go/issues/50573>, to promove the discussion 
> about it, but was closed before the discussion start =|)
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/8d6bb706-eafb-4c52-9ab2-10c8725c6533n%40googlegroups.com.

Reply via email to