Commit dba2faf2 authored by Rob Pike's avatar Rob Pike

doc/go_faq.html: explain the policy about unused imports a little better

This new text won't stop the whining but it might focus the whining a little more.

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/146680044
parent 9f408427
...@@ -1661,14 +1661,17 @@ Can I stop these complaints about my unused variable/import?</h3> ...@@ -1661,14 +1661,17 @@ Can I stop these complaints about my unused variable/import?</h3>
<p> <p>
The presence of an unused variable may indicate a bug, while The presence of an unused variable may indicate a bug, while
unused imports just slow down compilation. unused imports just slow down compilation,
Accumulate enough unused imports in your code tree and an effect that can become substantial as a program accumulates
things can get very slow. code and programmers over time.
For these reasons, Go allows neither. For these reasons, Go refuses to compile programs with unused
variables or imports,
trading short-term convenience for long-term build speed and
program clarity.
</p> </p>
<p> <p>
When developing code, it's common to create these situations Still, when developing code, it's common to create these situations
temporarily and it can be annoying to have to edit them out before the temporarily and it can be annoying to have to edit them out before the
program will compile. program will compile.
</p> </p>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment