Skip to content

Commit 4de4e0c

Browse files
committed
Remove comments from new code
1 parent 06d583d commit 4de4e0c

4 files changed

Lines changed: 0 additions & 33 deletions

File tree

composition.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"gopkg.in/yaml.v3"
1111
)
1212

13-
// FromYAMLFiles merges multiple YAML files. Later files override earlier ones.
1413
func FromYAMLFiles(paths ...string) Source {
1514
merged, err := mergeFiles(paths, func(data []byte) (map[string]any, error) {
1615
var m map[string]any
@@ -22,7 +21,6 @@ func FromYAMLFiles(paths ...string) Source {
2221
return &multiFileSource{name: "yaml", data: merged}
2322
}
2423

25-
// FromJSONFiles merges multiple JSON files. Later files override earlier ones.
2624
func FromJSONFiles(paths ...string) Source {
2725
merged, err := mergeFiles(paths, func(data []byte) (map[string]any, error) {
2826
var m map[string]any
@@ -34,7 +32,6 @@ func FromJSONFiles(paths ...string) Source {
3432
return &multiFileSource{name: "json", data: merged}
3533
}
3634

37-
// FromTOMLFiles merges multiple TOML files. Later files override earlier ones.
3835
func FromTOMLFiles(paths ...string) Source {
3936
merged, err := mergeFiles(paths, func(data []byte) (map[string]any, error) {
4037
var m map[string]any
@@ -62,7 +59,6 @@ func mergeFiles(paths []string, parse func([]byte) (map[string]any, error)) (map
6259
return merged, nil
6360
}
6461

65-
// deepMerge merges src into dst. Nested maps are merged recursively; scalars are overwritten.
6662
func deepMerge(dst, src map[string]any) {
6763
for k, v := range src {
6864
if srcMap, ok := v.(map[string]any); ok {

otel/tracer.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
// Package otel provides OpenTelemetry tracing integration for confkit.
2-
//
3-
// Usage:
4-
//
5-
// import "github.com/MimoJanra/confkit/otel"
6-
//
7-
// cfg, err := otel.Load[Config](ctx, tracer,
8-
// confkit.FromEnv(),
9-
// confkit.FromYAML("config.yaml"),
10-
// )
111
package otel
122

133
import (
@@ -19,7 +9,6 @@ import (
199
"go.opentelemetry.io/otel/trace"
2010
)
2111

22-
// Load wraps confkit.Load with an OpenTelemetry span.
2312
func Load[T any](ctx context.Context, tracer trace.Tracer, sources ...confkit.Source) (T, error) {
2413
ctx, span := tracer.Start(ctx, "confkit.Load")
2514
defer span.End()
@@ -38,7 +27,6 @@ func Load[T any](ctx context.Context, tracer trace.Tracer, sources ...confkit.So
3827
return cfg, nil
3928
}
4029

41-
// LoadWithOptions wraps confkit.LoadWithOptions with an OpenTelemetry span.
4230
func LoadWithOptions[T any](ctx context.Context, tracer trace.Tracer, options ...confkit.Option) (T, error) {
4331
ctx, span := tracer.Start(ctx, "confkit.Load")
4432
defer span.End()

prometheus/metrics.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
// Package prometheus provides Prometheus metrics integration for confkit.
2-
//
3-
// Usage:
4-
//
5-
// import "github.com/MimoJanra/confkit/prometheus"
6-
//
7-
// m := prometheus.NewMetrics(prometheus.DefaultRegisterer)
8-
// cfg, err := confkit.LoadWithOptions[Config](
9-
// confkit.WithSource(confkit.FromEnv()),
10-
// m.Hook(),
11-
// )
121
package prometheus
132

143
import (
@@ -18,14 +7,12 @@ import (
187
"github.com/prometheus/client_golang/prometheus"
198
)
209

21-
// Metrics holds Prometheus instruments for confkit load operations.
2210
type Metrics struct {
2311
loadsTotal *prometheus.CounterVec
2412
loadDuration prometheus.Histogram
2513
errorsTotal *prometheus.CounterVec
2614
}
2715

28-
// NewMetrics creates and registers Prometheus metrics.
2916
func NewMetrics(reg prometheus.Registerer) *Metrics {
3017
m := &Metrics{
3118
loadsTotal: prometheus.NewCounterVec(prometheus.CounterOpts{
@@ -46,10 +33,8 @@ func NewMetrics(reg prometheus.Registerer) *Metrics {
4633
return m
4734
}
4835

49-
// DefaultRegisterer is prometheus.DefaultRegisterer.
5036
var DefaultRegisterer = prometheus.DefaultRegisterer
5137

52-
// Hook returns a confkit.Option that records metrics for every Load call.
5338
func (m *Metrics) Hook() confkit.Option {
5439
return confkit.WithLoadHook(func(success bool, d time.Duration, errCount int) {
5540
if success {

validators_builtin.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ var (
1717
hostnameRegex = regexp.MustCompile(`^[a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?)*$`)
1818
)
1919

20-
// validateBuiltin handles built-in format validators.
21-
// Returns (FieldError, true) if the rule was recognized, (FieldError{}, false) if not.
2220
func (v *Validator) validateBuiltin(fieldVal reflect.Value, field FieldInfo, rule ValidationRule) (FieldError, bool) {
2321
switch rule.Name {
2422
case "email":

0 commit comments

Comments
 (0)