summaryrefslogtreecommitdiffhomepage
path: root/tools/go_generics/defs.bzl
diff options
context:
space:
mode:
authorMatthias Bertschy <matthias.bertschy@gmail.com>2019-07-04 08:33:00 +0200
committerMatthias Bertschy <matthias.bertschy@gmail.com>2019-07-12 08:09:48 +0200
commit239d7c6fdf344fe7051328056b7578657c7b6950 (patch)
treeeb586f1fa583c86b7834718e2fa35974b9f0df7e /tools/go_generics/defs.bzl
parent67f2cefce02816307805699c3462d6fd7ce61b69 (diff)
go_generics: treat the Sel part of an ast.SelectorExpr
Diffstat (limited to 'tools/go_generics/defs.bzl')
-rw-r--r--tools/go_generics/defs.bzl4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/go_generics/defs.bzl b/tools/go_generics/defs.bzl
index 999fb3426..596bf51be 100644
--- a/tools/go_generics/defs.bzl
+++ b/tools/go_generics/defs.bzl
@@ -93,6 +93,9 @@ def _go_template_instance_impl(ctx):
args += [("-c=%s=%s" % (p[0], p[1])) for p in ctx.attr.consts.items()]
args += [("-import=%s=%s" % (p[0], p[1])) for p in ctx.attr.imports.items()]
+ if ctx.attr.anon:
+ args += ["-anon"]
+
ctx.actions.run(
inputs = [template.file],
outputs = [output],
@@ -129,6 +132,7 @@ go_template_instance = rule(
"types": attr.string_dict(),
"consts": attr.string_dict(),
"imports": attr.string_dict(),
+ "anon": attr.bool(mandatory=False, default=False),
"package": attr.string(mandatory = True),
"out": attr.output(mandatory = True),
"_tool": attr.label(executable = True, cfg = "host", default = Label("//tools/go_generics")),