1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-03-23 20:32:32 +02:00
Asim Aslam d94936f6c9
v3 ()
* v3

* revert plugins

* fixup some issues
2021-01-20 13:54:31 +00:00

21 lines
375 B
Go

package cli
import (
"context"
"github.com/asim/go-micro/v3/config/source"
"github.com/micro/cli/v2"
)
type contextKey struct{}
// Context sets the cli context
func Context(c *cli.Context) source.Option {
return func(o *source.Options) {
if o.Context == nil {
o.Context = context.Background()
}
o.Context = context.WithValue(o.Context, contextKey{}, c)
}
}