merge stable #62

Merged
vtolstov merged 4 commits from master into v3 2021-11-18 16:01:10 +03:00
Showing only changes of commit b9bbfdf159 - Show all commits

View File

@ -52,3 +52,13 @@ func SetLoadOption(k, v interface{}) LoadOption {
o.Context = context.WithValue(o.Context, k, v)
}
}
// SetWatchOption returns a function to setup a context with given value
func SetWatchOption(k, v interface{}) WatchOption {
return func(o *WatchOptions) {
if o.Context == nil {
o.Context = context.Background()
}
o.Context = context.WithValue(o.Context, k, v)
}
}