Commit 4a83235 1 parent 986de7e commit 4a83235 Copy full SHA for 4a83235
File tree 3 files changed +49
-2533
lines changed
3 files changed +49
-2533
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,13 @@ package semconv // import "go.opentelemetry.io/otel/semconv/{{params.tag}}"
8
8
9
9
import "go.opentelemetry.io/otel/attribute"
10
10
{% - for group in ctx %}
11
+ {% - set ns = namespace (attrs =0) %}
12
+ {% - for attribute in group .attributes if not attribute .deprecated %}
13
+ {% - set ns .attrs = ns .attrs + 1 %}
14
+ {% - endfor %}
15
+ {% - if ns .attrs > 0 %}
11
16
{{- h.generate_consts(group) }}
12
17
{{- h.generate_funcs(group) }}
13
18
{{- h.generate_vars(group) }}
19
+ {% - endif %}
14
20
{% - endfor %}
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ Stability: {{ attr.stability | title }}
48
48
49
49
{{ ["Namespace: " ~ group.root_namespace] | comment(format="go") }}
50
50
const (
51
- {% - for attribute in group .attributes %}
51
+ {% - for attribute in group .attributes if not attribute . deprecated %}
52
52
{#- TODO: Handle template attributes. #}
53
53
{% - if not attribute .type is template_type %}
54
54
{{ keydoc(attribute) | comment(format="go_1tab") }}
@@ -59,7 +59,7 @@ const (
59
59
{% - endmacro -%}
60
60
61
61
{% - macro generate_funcs (group ) -%}
62
- {% - for attribute in group .attributes %}
62
+ {% - for attribute in group .attributes if not attribute . deprecated %}
63
63
{#- TODO: Handle template attributes. #}
64
64
{% - if not attribute .type is template_type %}
65
65
@@ -73,7 +73,7 @@ func {{to_go_name(attribute.name)}}(val {{attribute.type | instantiated_type | m
73
73
74
74
{% - macro generate_vars (group ) -%}
75
75
{#- Render values for enums #}
76
- {% - for attribute in group .attributes %}
76
+ {% - for attribute in group .attributes if not attribute . deprecated %}
77
77
{% - if attribute is enum %}
78
78
79
79
{{ ["Enum values for " ~ attribute.name] | comment(format="go") }}
You can’t perform that action at this time.
0 commit comments