ok, thank you !
Le lundi 1 octobre 2018 19:31:58 UTC+2, Ian Lance Taylor a écrit :
>
> On Mon, Oct 1, 2018 at 7:56 AM, Pierre Durand > wrote:
> >
> > My code:
> > package main
> >
> > func main() {
> > a := 1
> > _ = func() {
> > a := 2
> > _ = a
> > }
> > _ = func() (a int) {
> > a
On Mon, Oct 1, 2018 at 7:56 AM, Pierre Durand wrote:
>
> My code:
> package main
>
> func main() {
> a := 1
> _ = func() {
> a := 2
> _ = a
> }
> _ = func() (a int) {
> a = 2
> return a
> }
> _ = a
> }
>
> "go vet -shadow" reports a problem with the first function/closure, but
> nothing for the
My code:
package main
func main() {
a := 1
_ = func() {
a := 2
_ = a
}
_ = func() (a int) {
a = 2
return a
}
_ = a
}
"go vet -shadow" reports a problem with the first function/closure, but
nothing for the second one.
Why ?
If I understand correctly, it doesn't consider variable declaration in