"go vet -shadow" checks short variable declarations only. On Monday, October 1, 2018 at 10:56:13 AM UTC-4, 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 second one. > Why ? > > If I understand correctly, it doesn't consider variable declaration in a > named return value to be a shadowing issue. > Is it expected ? >
-- 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. For more options, visit https://groups.google.com/d/optout.