Merge remote-tracking branch 'origin/v3' into v3
All checks were successful
lint / lint (pull_request) Successful in 1m0s
test / test (pull_request) Successful in 3m29s

This commit is contained in:
2024-12-18 10:51:08 +03:00
16 changed files with 162 additions and 45 deletions

View File

@@ -15,6 +15,15 @@ func FromContext(ctx context.Context) (Client, bool) {
return c, ok
}
// MustContext get client from context
func MustContext(ctx context.Context) Client {
c, ok := FromContext(ctx)
if !ok {
panic("missing client")
}
return c
}
// NewContext put client in context
func NewContext(ctx context.Context, c Client) context.Context {
if ctx == nil {