Skip to content

Commit

Permalink
feat(cron): enable cron to support context.Context
Browse files Browse the repository at this point in the history
  • Loading branch information
flc1125 committed Oct 26, 2024
1 parent 40c8e7e commit 3e11fdb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions option_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import (
)

func TestWithContext(t *testing.T) {
ctx := context.WithValue(context.Background(), "key", "value") // nolint:revive
type key struct{}
ctx := context.WithValue(context.Background(), key{}, "value")
c := New(WithContext(ctx))
assert.Equal(t, "value", c.ctx.Value("key"))
assert.Equal(t, "value", c.ctx.Value(key{}))
}

func TestWithLocation(t *testing.T) {
Expand Down

0 comments on commit 3e11fdb

Please sign in to comment.