You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.