Closed
Description
by SRRajesh1989:
A code like: package main var strx, inty = "hello", 123 func main() { } Note that strx and inty are not used anywhere in the program. But go fail to report compilation error because of unused variable. But making that declaration inside the function like below, generates compilation error. package main func main() { var strx, inty = "hello", 123 } Is this the intended behavior? It will be better to report error in both the cases.