News for hackers. Stuff that matters.
Re:Deadcode: Finding unreachable functions in Go by mcdee on Tuesday January 23, 2024 @02:09PM (#39108074)
It's called ineffassign
Re:Deadcode: Finding unreachable functions in Go by jerf on Tuesday January 23, 2024 @02:46PM (#39108689)
One of the mandatory ones, in my opinion. It's 3rd or 4th in terms of the linter that catches actual bugs for me before they are bugs, behind the number one errcheck and probably number two "unused", checking for unexported package-level variables that are unused. Go prohibits variables to be unused within a function but the compiler does not check that unexported package-level variables are used; this has helped me find a lot of places where I created a metric for something but never quite followed through to actually triggering it, log messages, bespoke errors, etc.