That's correct. I've found that it's most often a mistake when working with 
slices. But for maps, there is some use for it, such as relying on maps 
being unordered to select random values from the map, although there should 
be a better way to do that.
An analysis check for this should produce a warning. I'm betting that since 
it's an error in most of the cases I've come across, a warning will be 
useful most of the time.

On Monday, March 15, 2021 at 8:34:14 AM UTC+1 Jan Mercl wrote:

> On Mon, Mar 15, 2021 at 3:03 AM Barisere Jonathan 
> <barry.jo...@gmail.com> wrote: 
>
> > I think this mistake can be caught by code analysis tools, but I don't 
> know of any that catches these. 
>
> IMO the problem is that while sometimes it's a mistake, in some other 
> cases it is not and it is perfectly good, reasonable code. Next to 
> impossible for a machine to decide which case it sees. 
>

-- 
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/dffb2987-2c48-4d21-af0d-18a44ac343f9n%40googlegroups.com.

Reply via email to