<p dir="auto">by <strong>jdnurmi</strong>:</p>
<pre class="notranslate">Often while experimenting or debugging a module, I'll find it necessary (or desirable)
to import the 'fmt' module to generate some temporary debugging printfs.

Alternatively, I might temporarily comment out a section that is the only user of the
"os",'io' or 'http' modules in 'helper' files for debugging.

This also occurs with variables or types that get commented out in a loop, the most
common occurance is something of the form:

for k,v := range someMap{
  doSomething(k)
  doSomethingElse(v)
}

There, commenting out either inner loop line will make the compilation fail since k/v
was 'set' but unused.

When I do this, go correctly flags that I've imported a module without using it.  I
appreciate its semantic desire for a clean compile, but there are times when I know in
advance "It's coming back in 10 minutes, so shut-up", and would like to be
able to (for example) set my debug-build target to include
--warn-unused{,-import,-variable}.

I realize this is a convenience feature that's counter to the clarity of the language,
but especially as I first started learning it, the constant jumping around in the file
to satisfy the compilers need for "everything in its place, and every place
used" often became a frustrating irritant.

I would encourage leaving the default as is, I would just like a flag (or  a pointer to
it in the doco if it already exists) to allow those issues to not inhibit my build.</pre>
<pre class="notranslate">(Sorry I haven't managed to trim down the test case.  In doing so, I kept running into
the formatting problem I just reported with strange comment movements.)


What steps will reproduce the problem?
1. git clone github.com/dgryski/dkrcrypt  
2. edit aria.go, add "var _ cipher.Block = &amp;AriaCipher{}" at the bottom
3. goimports

What is the expected output?
The crypto/cipher import is added.

What do you see instead?
I get a warning added to the top of my fail (which then fails to compile -- this may be
vim integration problems).
2013/12/18 10:16:12 addImportViaSourceModification error: 194:3: expected 1 expression
and the crypto/cipher import is added oddly split across a comment:

import
  
// The ARIA Block cipher from KISA
// Copyright (c) 2012 Damian Gryski &lt;damian@gryski.com&gt;
// Licensed under the GPLv3 or, at your option, any later version.
"crypto/cipher"</pre>