3 ms·
> Go handles dead code by not allowing you to compile something with dead code. This is obviously not true and is easily disproved. Here's a program that comp
by chrisseaton 10y ago
> Go handles dead code by not allowing you to compile something with dead code.
This is obviously not true and is easily disproved.
Here's a program that compiles but has statically provably dead code on line 15 https://play.golang.org/p/_XcxezHV-6 https://play.golang.org/p/_XcxezHV-6.
But even if I couldn't give you an example like that where the dead code is obvious, dead code is produced by the compiler itself as it optimises, and by code generation tools.