1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2026-06-03 18:35:08 +02:00

Fix CPUModeSystem variable name (#7233)

Do not trim a package prefix when it is the same as the package name.
Assume the name itself has semantic meaning and will not stutter.

Fix #7232
This commit is contained in:
Tyler Yahn
2025-08-25 07:06:50 -07:00
committed by GitHub
parent be28c6bc8f
commit e7fa5ba72f
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -14,7 +14,7 @@
{%- endmacro -%}
{%- macro to_go_name(fqn="", pkg="") -%}
{%- if pkg != "" -%}
{%- if pkg != "" and fqn != pkg -%}
{%- set n = pkg | length -%}
{%- if pkg == fqn[:n] -%}
{%- set fqn = fqn[n:] -%}
+2 -2
View File
@@ -25,8 +25,8 @@ type CPUModeAttr string
var (
// CPUModeUser is the standardized value "user" of CPUModeAttr.
CPUModeUser CPUModeAttr = "user"
// CPUMode is the standardized value "system" of CPUModeAttr.
CPUMode CPUModeAttr = "system"
// CPUModeSystem is the standardized value "system" of CPUModeAttr.
CPUModeSystem CPUModeAttr = "system"
// CPUModeNice is the standardized value "nice" of CPUModeAttr.
CPUModeNice CPUModeAttr = "nice"
// CPUModeIdle is the standardized value "idle" of CPUModeAttr.