Skip to content

Commit

Permalink
fix: modified the bad spelling and added unit test
Browse files Browse the repository at this point in the history
Signed-off-by: guanwenbo <guanwenbo@inke.cn>
  • Loading branch information
guanwenbo committed Dec 21, 2020
1 parent 33cd4a2 commit 85164cb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions config/config_test.go
Expand Up @@ -899,3 +899,13 @@ func TestThrottlerDefaultConfig(t *testing.T) {
assert.NoError(t, err)
defer closeCloser(t, closer)
}

func TestWithRandomNumber(t *testing.T) {
cfg := &Configuration{
ServiceName: "test-random-number",
}
randomNum := func() uint64 { return 1 }
_, closer, err := cfg.NewTracer(WithRandomNunmber(randomNum))
assert.NoError(t, err)
defer closeCloser(t, closer)
}
4 changes: 2 additions & 2 deletions config/options.go
Expand Up @@ -148,8 +148,8 @@ func Extractor(format interface{}, extractor jaeger.Extractor) Option {
}
}

// WithRandonNunmber set the Tracer random number func
func WithRandonNunmber(f func() uint64) Option {
// WithRandomNunmber set the Tracer random number func
func WithRandomNunmber(f func() uint64) Option {
return func(c *Options) {
c.randomNumber = f
}
Expand Down

0 comments on commit 85164cb

Please sign in to comment.