Skip to content

Commit

Permalink
otelhttp: Refactor Option interface (#750)
Browse files Browse the repository at this point in the history
* Refactor Option interface

* Refine Option doc comment
  • Loading branch information
pellared committed Jul 2, 2021
1 parent 6fad34d commit 6fd824a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions instrumentation/net/http/otelhttp/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ type config struct {
MeterProvider metric.MeterProvider
}

// Option Interface used for setting *optional* config properties
// Option interface used for setting optional config properties.
type Option interface {
Apply(*config)
apply(*config)
}

// OptionFunc provides a convenience wrapper for simple Options
// that can be represented as functions.
type OptionFunc func(*config)

func (o OptionFunc) Apply(c *config) {
func (o OptionFunc) apply(c *config) {
o(c)
}

Expand All @@ -66,7 +66,7 @@ func newConfig(opts ...Option) *config {
MeterProvider: global.GetMeterProvider(),
}
for _, opt := range opts {
opt.Apply(c)
opt.apply(c)
}

c.Tracer = c.TracerProvider.Tracer(
Expand Down

0 comments on commit 6fd824a

Please sign in to comment.