Hello all,

Very new gopher here (also first time using Groups, please excuse poor 
etiquette).  I was curious why the following basic program compiles with an 
unused var. Is it the case that the compiler only complains about unused 
vars in a function body?

package main

import (
"fmt"
)

var (
x int
)

func main() {
fmt.Println("Hello, playground")
}

-- 
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/d4e80994-8f42-4fe9-888f-26dd973ccbc3n%40googlegroups.com.

Reply via email to