Skip to content

Commit

Permalink
libbeat/cfgfile: remove futile errors.Is call (elastic#40851)
Browse files Browse the repository at this point in the history
Also remove the no-lint directive and use errors.As to identify the type of
the error returned by createRunner.
  • Loading branch information
efd6 authored Sep 30, 2024
1 parent 4fb90ac commit 98d34a8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libbeat/cfgfile/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ func (r *RunnerList) Reload(configs []*reload.ConfigWithMeta) error {
for hash, config := range startList {
runner, err := createRunner(r.factory, r.pipeline, config)
if err != nil {
errors.Is(err, &common.ErrInputNotFinished{})
if _, ok := err.(*common.ErrInputNotFinished); ok { //nolint:errorlint // ErrInputNotFinished is a struct type, not an expression/error value
if errors.As(err, new(*common.ErrInputNotFinished)) {
// error is related to state, we should not log at error level
r.logger.Debugf("Error creating runner from config: %s", err)
} else {
Expand Down

0 comments on commit 98d34a8

Please sign in to comment.