A typed nil still compares non-nil when stuffed into an interface. Thanks to Tom (ORBAT) for pointing this out.
@@ -208,7 +208,10 @@ func (p *Producer) Close() error {
for event := range p.errors {
errors = append(errors, event)
}
- return errors
+ if len(errors) > 0 {
+ return errors
+ }
+ return nil
///////////////////////////////////////////