Re: [go-nuts] Code compiles with unused var block

2021-02-03 Thread Danny H
Thanks so much Matt, appreciate your wisdom. On Wednesday, February 3, 2021 at 11:45:50 AM UTC-5 matthew...@nytimes.com wrote: > You are correct sir, and unfortunately, go vet doesn't find it either. > But if you lint your code with golangci-lint ( > https://github.com/golangci/golangci-lint)

Re: [go-nuts] Code compiles with unused var block

2021-02-03 Thread Matthew Holiday
You are correct sir, and unfortunately, go vet doesn't find it either. But if you lint your code with golangci-lint ( https://github.com/golangci/golangci-lint) the deadcode linter will find it for you. On Wed, Feb 3, 2021 at 9:35 AM Danny Hart wrote: > Hello all, > > Very new gopher here (also

[go-nuts] Code compiles with unused var block

2021-02-03 Thread Danny Hart
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 (