mirror of
https://github.com/go-micro/go-micro.git
synced 2025-07-06 22:35:51 +02:00
20 lines
353 B
Go
20 lines
353 B
Go
![]() |
package pkger
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"github.com/micro/go-micro/v2/config/source"
|
||
|
)
|
||
|
|
||
|
type pkgerPathKey struct{}
|
||
|
|
||
|
// WithPath sets the path to pkger
|
||
|
func WithPath(p string) source.Option {
|
||
|
return func(o *source.Options) {
|
||
|
if o.Context == nil {
|
||
|
o.Context = context.Background()
|
||
|
}
|
||
|
o.Context = context.WithValue(o.Context, pkgerPathKey{}, p)
|
||
|
}
|
||
|
}
|