On Sun, 27 Oct 2019, 02:52 Marvin Renich, <m...@renich.org> wrote:

> * Denis Cheremisov <denis.cheremi...@gmail.com> [191026 06:09]:
> > The answer was simple:
> >
> > var fset token.FileSet – wrong
> >
> > fset := token.NewFileSet() – right
>
> I believe I am in the minority here, but I am not a singleton minority.
> There are at least several of us who agree that «var» should be used
> over «:=» whenever possible, and when you do use «:=», you should be
> very careful, because it is frequently the cause of hidden shadowing
> bugs.  This is especially true when declaring multiple variables.
>
> I strongly encourage you to use
>
>   var fset = token.NewFileSet()
>
> rather than
>
>   fset := token.NewFileSet()
>

Those two alternatives do exactly the same thing AFAIK. How is the latter
vulnerable to shadowing bugs where the former isn't?

>
> ...Marvin
>
> --
> 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/20191027025214.uqkd4rtu6gbrbt5b%40basil.wdw
> .
>

-- 
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/CAJhgacjvdw61p7yzCtofsFeVMWfWO_11NQu2VMpttqT5f12YBQ%40mail.gmail.com.

Reply via email to