[cmd/mdatagen] Add go_name support to go_struct config in metadata.yaml#15486
Conversation
Added an issue reference to the enhancement note.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15486 +/- ##
=======================================
Coverage 91.08% 91.08%
=======================================
Files 726 726
Lines 47929 47937 +8
=======================================
+ Hits 43656 43664 +8
Misses 2978 2978
Partials 1295 1295 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will create unknown performance changes
|
5244834
Description
This change introduces explicit
go_namefield undergo_structinmetadata.yaml. Component authors can now set any custom Go field name for a config property:component: type: string x-customType: go.opentelemetry.io/collector/component.ID go_struct: go_name: ComponentIDThis generates
ComponentID component.IDin the config struct while keepingmapstructure:"component"for YAML unmarshaling. Ifgo_nameis omitted, the property name is used as-is .Testing
Authorship