Ya I think _, _ = blah() is ugly, but it's actually not a bad idea to 
communicate to the next person that you did really mean to ignore that 
value, error.  Otherwise they have to ask you. So I usually comment it, but 
the linter can't read the comment, so actually the _ is better.

On Friday, December 10, 2021 at 1:53:31 AM UTC-6 Amnon wrote:

> Indeed.
>
> There are quite a few linters out there which object to good idiomatic 
> code and 
> which would fail the Go Standard Library.
>
> And too many people are happy to pollute their codebase with extraneous 
> noise,
> rather than fixing the linters, or using just using high quality linters 
> (such as go vet, and staticcheck).
>
> On Friday, 10 December 2021 at 07:21:56 UTC Jason E. Aten wrote:
>
>> 6 is probably because of the linters that complain if you don't.
>>
>> 6) Code where almost every line prefixed by `_, _ =`
>>> and the underscores won't go away when you wipe your screen
>>>
>>>
>>>

-- 
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/c4dcdcc0-496a-41ec-8c4e-e6b12fa17920n%40googlegroups.com.

Reply via email to