In the Go web server example here: http://golang.org/doc/effective_go.html#web_server
The following line of code works
var addr = flag.String(\"addr\
The Go Programming Language Specification
Short variable declarations
A short variable declaration uses the syntax:
ShortVarDecl = IdentifierList ":=" ExpressionList .Short variable declarations may appear only inside functions.
In your example, changing the variable declaration statement outside a function body
var addr = flag.String("addr", ":1718", "http service address")
to a short variable declaration statement outside a function body
addr := flag.String("addr", ":1718", "http service address")
fails with compiler error "non-declaration statement outside function body."