Commit d75b91b
committed
[cmd/mdatagen] only import "slices" when a required reagg attribute exists
The config.go.tmpl unconditionally imports "slices" whenever
reaggregation is enabled and there are aggregatable (recommended/opt_in)
attributes. However, slices.Contains is only emitted for *required*
attributes. When a receiver has reaggregation enabled but carries no
required attributes, the generated file fails to compile with
"slices imported and not used".
Add a second template variable $hasRequiredReagAttr and gate the
"slices" import on it.
Signed-off-by: Ali <alliasgher123@gmail.com>1 parent 2854c98 commit d75b91b
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
0 commit comments