mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-10 07:04:24 +00:00
This reverts commit 8ec5e4916c
.
This commit is somehow causing AWS verification (and possibly others) to
not work.
This commit is contained in:
parent
8ec5e4916c
commit
e8b5e3cea3
2 changed files with 15 additions and 4 deletions
|
@ -18,11 +18,22 @@ var (
|
||||||
type Context interface {
|
type Context interface {
|
||||||
context.Context
|
context.Context
|
||||||
Logger() logr.Logger
|
Logger() logr.Logger
|
||||||
|
Parent() context.Context
|
||||||
|
SetParent(ctx context.Context) Context
|
||||||
}
|
}
|
||||||
|
|
||||||
// CancelFunc is a type alias to context.CancelFunc to allow use as if they are
|
// Parent returns the parent context.
|
||||||
// the same types.
|
func (l logCtx) Parent() context.Context {
|
||||||
type CancelFunc = context.CancelFunc
|
return l.Context
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetParent sets the parent context on the context.
|
||||||
|
func (l logCtx) SetParent(ctx context.Context) Context {
|
||||||
|
l.Context = ctx
|
||||||
|
return l
|
||||||
|
}
|
||||||
|
|
||||||
|
type CancelFunc context.CancelFunc
|
||||||
|
|
||||||
// logCtx implements Context.
|
// logCtx implements Context.
|
||||||
type logCtx struct {
|
type logCtx struct {
|
||||||
|
|
|
@ -130,7 +130,7 @@ func Start(ctx context.Context, options ...EngineOption) *Engine {
|
||||||
sourcesWg, egCtx := errgroup.WithContext(ctx)
|
sourcesWg, egCtx := errgroup.WithContext(ctx)
|
||||||
sourcesWg.SetLimit(e.concurrency)
|
sourcesWg.SetLimit(e.concurrency)
|
||||||
e.sourcesWg = sourcesWg
|
e.sourcesWg = sourcesWg
|
||||||
ctx = context.WithLogger(egCtx, ctx.Logger())
|
ctx.SetParent(egCtx)
|
||||||
|
|
||||||
if len(e.decoders) == 0 {
|
if len(e.decoders) == 0 {
|
||||||
e.decoders = decoders.DefaultDecoders()
|
e.decoders = decoders.DefaultDecoders()
|
||||||
|
|
Loading…
Reference in a new issue