Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Commit bbf6cb4

Browse files
committed
Silence "unused" errors for transitive imports
1 parent 2b0a12e commit bbf6cb4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/gentest

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ parser.add_argument('-modname', required=True,
3333
template = textwrap.dedent("""
3434
package %s
3535
import (
36-
\t"os"
36+
\t"testing"
3737
\t"grumpy"
3838
\t%s
3939
)
@@ -87,7 +87,7 @@ def main(args):
8787
# Make sure traceback is available in all Python binaries.
8888
names.add('traceback')
8989

90-
imports = '\n\t'.join('"%s"' % _package_name(name) for name in names)
90+
imports = '\n\t'.join('_ "%s"' % _package_name(name) for name in names)
9191

9292
testfile_contents = template % (modname, imports)
9393
with open(os.path.join(mod_dir, 'module_test.go'), 'w') as go_testfile:

0 commit comments

Comments
 (0)