[chore] Only set default detectors if none are provided (#3147)

This commit is contained in:
Miccah 2024-08-01 17:15:06 -07:00 committed by GitHub
parent 605d037e45
commit 38e844f968
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -308,7 +308,10 @@ func (e *Engine) setDefaults(ctx context.Context) {
e.decoders = decoders.DefaultDecoders()
}
e.detectors = append(e.detectors, DefaultDetectors()...)
// Only use the default detectors if none are provided.
if len(e.detectors) == 0 {
e.detectors = DefaultDetectors()
}
if e.dispatcher == nil {
e.dispatcher = NewPrinterDispatcher(new(output.PlainPrinter))