Skip to content

Commit a697ce7

Browse files
committed
Merge remote-tracking branch 'origin/fix/featuregate-empty-segment-validation' into fix/featuregate-empty-segment-validation
2 parents 8852a0c + d437631 commit a697ce7

68 files changed

Lines changed: 362 additions & 188 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmd/builder/internal/builder/main.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ func GetModules(cfg *Config) error {
200200
if semver.MajorMinor(coreDepVersion) != betaVersion {
201201
return fmt.Errorf(
202202
"%w: core collector version calculated by component dependencies %q does not match configured version %q. %s",
203-
ErrVersionMismatch, coreDepVersion, betaVersion, skipStrictMsg)
203+
ErrVersionMismatch, coreDepVersion, betaVersion, skipStrictMsg,
204+
)
204205
}
205206

206207
for _, mod := range cfg.allComponents() {
@@ -218,7 +219,8 @@ func GetModules(cfg *Config) error {
218219
if semver.MajorMinor(moduleDepVersion) != semver.MajorMinor(version) {
219220
return fmt.Errorf(
220221
"%w: component %q version calculated by dependencies %q does not match configured version %q. %s",
221-
ErrVersionMismatch, module, moduleDepVersion, version, skipStrictMsg)
222+
ErrVersionMismatch, module, moduleDepVersion, version, skipStrictMsg,
223+
)
222224
}
223225
}
224226

cmd/mdatagen/internal/cfggen/generation.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,8 @@ func formatSimpleValue(md *ConfigMetadata, name string, defaultValue any, rootPa
763763
value := defaultValues[keyName]
764764
exps = append(
765765
exps,
766-
fmt.Sprintf("%q: %v", keyName, FormatDefaultValue(md.Values, name, value, rootPackage, componentPackage)))
766+
fmt.Sprintf("%q: %v", keyName, FormatDefaultValue(md.Values, name, value, rootPackage, componentPackage)),
767+
)
767768
}
768769
return fmt.Sprintf("map[string]%s{%s}", typeExpr, strings.Join(exps, ", "))
769770
}

cmd/mdatagen/internal/command.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ func run(ymlPath string) error {
142142
err = inlineReplaceWithFns(
143143
filepath.Join(tmplDir, "readme.md.tmpl"),
144144
filepath.Join(ymlDir, "README.md"),
145-
md, statusStart, statusEnd, md.GeneratedPackageName, importRootPath, nil)
145+
md, statusStart, statusEnd, md.GeneratedPackageName, importRootPath, nil,
146+
)
146147
if err != nil {
147148
return err
148149
}
@@ -501,7 +502,8 @@ func templatize(tmplFile string, funcMap template.FuncMap) *template.Template {
501502
New(filepath.Base(tmplFile)).
502503
Option("missingkey=error").
503504
Funcs(funcMap).
504-
ParseFS(TemplateFS, "templates/helper.tmpl", strings.ReplaceAll(tmplFile, "\\", "/")))
505+
ParseFS(TemplateFS, "templates/helper.tmpl", strings.ReplaceAll(tmplFile, "\\", "/")),
506+
)
505507
}
506508

507509
func executeTemplate(tmplFile string, md Metadata, goPackage, importRootPath string, fns template.FuncMap) ([]byte, error) {

cmd/mdatagen/internal/metric.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ func validateSemConvMetricURL(rawURL, semConvVersion, metricName string) error {
146146
if !re.MatchString(rawURL) {
147147
return fmt.Errorf(
148148
"invalid semantic-conventions URL: want https://github.com/open-telemetry/semantic-conventions/blob/%s/*#%s, got %q",
149-
semConvVersion, anchor, rawURL)
149+
semConvVersion, anchor, rawURL,
150+
)
150151
}
151152
return nil
152153
}

component/componenttest/configtest.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ func checkStructFieldTags(f reflect.StructField) error {
103103
case "squash":
104104
if (f.Type.Kind() != reflect.Struct) && (f.Type.Kind() != reflect.Ptr || f.Type.Elem().Kind() != reflect.Struct) {
105105
return fmt.Errorf(
106-
"attempt to squash non-struct type on field %q", f.Name)
106+
"attempt to squash non-struct type on field %q", f.Name,
107+
)
107108
}
108109
case "remain":
109110
if f.Type.Kind() != reflect.Map && f.Type.Kind() != reflect.Interface {
@@ -128,7 +129,8 @@ func checkStructFieldTags(f reflect.StructField) error {
128129
"field %q has config tag %q which doesn't satisfy %q",
129130
f.Name,
130131
fieldTag,
131-
configFieldTagRegExp.String())
132+
configFieldTagRegExp.String(),
133+
)
132134
}
133135
}
134136

config/configgrpc/client_middleware_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ func newTestClientMiddleware(name string) extension.Extension {
8181

8282
// Continue the call with our updated context
8383
return invoker(newCtx, method, req, reply, cc, opts...)
84-
}),
84+
},
85+
),
8586
}, nil
8687
},
8788
}

config/configgrpc/server_middleware_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ func newTestServerMiddleware(name string) extension.Extension {
5555
) (any, error) {
5656
ctx = context.WithValue(ctx, middlewareCallsKey, append(getMiddlewareCalls(ctx), name))
5757
return handler(ctx, req)
58-
})}, nil
58+
},
59+
)}, nil
5960
},
6061
}
6162
}

config/confighttp/client_middleware_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ func newTestClientMiddleware(name string) component.Component {
5656
resp.ContentLength = int64(len(newBody))
5757

5858
return resp, nil
59-
}), nil
59+
},
60+
), nil
6061
}, nil
6162
},
6263
}

config/confighttp/confighttp_example_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ func ExampleServerConfig() {
2121
context.Background(),
2222
host.GetExtensions(),
2323
componenttest.NewNopTelemetrySettings(),
24-
http.HandlerFunc(func(http.ResponseWriter, *http.Request) {}))
24+
http.HandlerFunc(func(http.ResponseWriter, *http.Request) {}),
25+
)
2526
if err != nil {
2627
panic(err)
2728
}

config/confighttp/server.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ func (sc *ServerConfig) ToServer(ctx context.Context, extensions map[component.I
284284
}),
285285
otelhttp.WithMeterProvider(settings.MeterProvider),
286286
},
287-
serverOpts.OtelhttpOpts...)
287+
serverOpts.OtelhttpOpts...,
288+
)
288289

289290
// Enable OpenTelemetry observability plugin.
290291
handler = otelhttp.NewHandler(handler, "", otelOpts...)

0 commit comments

Comments
 (0)