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

Commit 8d321f0

Browse files
committed
[HACK] Should suppress _test from package name
1 parent 764af4c commit 8d321f0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tools/grumpc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,16 @@ def main(args):
9797
\t\tvar πE *πg.BaseException; _ = πE""")
9898

9999
go_package_name = args.modname.split('.')[-1]
100+
101+
# HACK: Should suppress _test from package name
102+
# See: https://github.com/google/grumpy/issues/383#issuecomment-353394740
103+
if go_package_name.endswith('_test'):
104+
final_package_name = go_package_name[:-5]
105+
else:
106+
final_package_name = go_package_name
107+
100108
modname = util.go_str(args.modname)
101-
writer.write_tmpl(tmpl, package=go_package_name,
109+
writer.write_tmpl(tmpl, package=final_package_name,
102110
import_testing='import πt "testing"' if args.astest else '',
103111
script=util.go_str(args.script))
104112
with writer.indent_block(2):

0 commit comments

Comments
 (0)