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

Commit

Permalink
[HACK] Should suppress _test from package name
Browse files Browse the repository at this point in the history
  • Loading branch information
alanjds committed Dec 21, 2017
1 parent 764af4c commit 8d321f0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tools/grumpc
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,16 @@ def main(args):
\t\tvar πE *πg.BaseException; _ = πE""")

go_package_name = args.modname.split('.')[-1]

# HACK: Should suppress _test from package name
# See: https://github.com/google/grumpy/issues/383#issuecomment-353394740
if go_package_name.endswith('_test'):
final_package_name = go_package_name[:-5]
else:
final_package_name = go_package_name

modname = util.go_str(args.modname)
writer.write_tmpl(tmpl, package=go_package_name,
writer.write_tmpl(tmpl, package=final_package_name,
import_testing='import πt "testing"' if args.astest else '',
script=util.go_str(args.script))
with writer.indent_block(2):
Expand Down

0 comments on commit 8d321f0

Please sign in to comment.