FWIW, consider first that :
if false {
foo()
bar()
}
is legal (and sometimes recommended by autorities, as opposed to
momentarily commenting out a block, and struggling with unused vars);
and second that :
func log(msg string, level uint) {
if level < appLevel {
triggerBigNetworkLogTool(msg)
}
}
is legal and useful, even if appLevel happens to be a uint constant with
value 0. See https://play.golang.org/p/nGbELUdvvu
The current policy seems to be: a unused variable is always regarded as a
compilation error, but unreachable code (dead code) is never a compilation
error.
On Tuesday, May 23, 2017 at 1:13:28 PM UTC+2, JuciĆ Andrade wrote:
>
> Now I understand it.
> Thank you, guys.
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.