Skip to content

Commit

Permalink
Check and return error
Browse files Browse the repository at this point in the history
  • Loading branch information
glinton authored and danielnelson committed Oct 12, 2018
1 parent 3db30b0 commit 8f67a2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/inputs/filecount/filecount.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ func absDuration(x time.Duration) time.Duration {
func (fc *FileCount) count(acc telegraf.Accumulator, basedir string, recursive bool) {
numFiles := int64(0)
walkFn := func(path string, file os.FileInfo, err error) error {
if file == nil {
return fmt.Errorf("Nil file found at %q", path)
if err != nil {
return err
}
if path == basedir {
return nil
Expand Down

0 comments on commit 8f67a2e

Please sign in to comment.