Re: [go-nuts] Global variable not used, but it works fine

2018-04-22 Thread Tyler Compton
Go does not flag unused global variables, it is intended functionality. I've personally found that unused global variables have a higher chance at being benign than local variables, but there's probably an argument to be made for flagging globals, too. On Sat, Apr 21, 2018, 06:30 wrote: > W

[go-nuts] Global variable not used, but it works fine

2018-04-21 Thread zpsyhapcst
What did you do? https://play.golang.org/p/aryK9Btv5kH What did you expect to see? There should be a error "declared and not used" What did you see instead? It seems work fine. System details ``` go version go1.10.1 windows/amd64 GOARCH="amd64" GOBIN="" GOCACHE="C:\Users\zps