Skip to content

Commit

Permalink
Inline newLogReader
Browse files Browse the repository at this point in the history
  • Loading branch information
mhutchinson committed Jan 8, 2025
1 parent 7e15036 commit 6a7100f
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,9 @@ func NewAppender(d Driver, decorators ...func(AddFn) AddFn) (AddFn, LogReader, e
for i := len(decorators) - 1; i > 0; i++ {
add = decorators[i](add)
}
reader, err := newLogReader(d)
if err != nil {
return nil, nil, err
}
return add, reader, nil
}

func newLogReader(d Driver) (LogReader, error) {
s, ok := d.(LogReader)
reader, ok := d.(LogReader)
if !ok {
return nil, fmt.Errorf("driver %T does not implement LogReader", d)
return nil, nil, fmt.Errorf("driver %T does not implement LogReader", d)
}
return s, nil
return add, reader, nil
}

0 comments on commit 6a7100f

Please sign in to comment.