Skip to content

Commit 4f03e60

Browse files
authored
[cmd/codecovgen] unexport config structs (open-telemetry#43861)
Limit the API exposed by this tool.
1 parent 733d9ab commit 4f03e60

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

cmd/codecovgen/main.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,19 @@ func main() {
9898
}
9999
}
100100

101-
// Component represents a component in the Codecov configuration.
102-
type Component struct {
101+
// component represents a component in the Codecov configuration.
102+
type component struct {
103103
ComponentID string `yaml:"component_id"`
104104
Name string `yaml:"name"`
105105
Paths []string `yaml:"paths"`
106106
}
107107

108-
type ComponentManagement struct {
109-
IndividualComponents []Component `yaml:"individual_components"`
108+
type componentManagement struct {
109+
IndividualComponents []component `yaml:"individual_components"`
110110
}
111111

112-
type CodecovConfig struct {
113-
ComponentManagement ComponentManagement `yaml:"component_management"`
112+
type codecovConfig struct {
113+
ComponentManagement componentManagement `yaml:"component_management"`
114114
}
115115

116116
var (
@@ -145,8 +145,8 @@ func generateComponentID(moduleName string, cli Args) (string, error) {
145145
}
146146

147147
// walkTree uses filepath.Walk to recursively traverse the base directory looking for go.mod files
148-
func walkTree(cli Args) (*CodecovConfig, error) {
149-
config := &CodecovConfig{}
148+
func walkTree(cli Args) (*codecovConfig, error) {
149+
config := &codecovConfig{}
150150

151151
err := filepath.WalkDir(cli.Dir, func(path string, entry fs.DirEntry, err error) error {
152152
if err != nil {
@@ -187,13 +187,13 @@ func walkTree(cli Args) (*CodecovConfig, error) {
187187
if err != nil {
188188
return err
189189
}
190-
component := Component{
190+
cmp := component{
191191
ComponentID: componentID,
192192
Name: componentID,
193193
Paths: []string{relativePath + "/**"},
194194
}
195195

196-
config.ComponentManagement.IndividualComponents = append(config.ComponentManagement.IndividualComponents, component)
196+
config.ComponentManagement.IndividualComponents = append(config.ComponentManagement.IndividualComponents, cmp)
197197

198198
return nil
199199
})
@@ -231,7 +231,7 @@ const (
231231

232232
var matchComponentSection = regexp.MustCompile("(?s)" + startComponentList + ".*" + endComponentList)
233233

234-
func addComponentList(config *CodecovConfig) error {
234+
func addComponentList(config *codecovConfig) error {
235235
var buf bytes.Buffer
236236
enc := yaml.NewEncoder(&buf)
237237
enc.SetIndent(2)

0 commit comments

Comments
 (0)