Skip to content

Commit

Permalink
[chore] [scrapererror] Remove nil check from IsPartialScrapeError (#9555
Browse files Browse the repository at this point in the history
)

Remove the nil check from `IsPartialScrapeError` as redundant,
`errors.As` has the same condition
  • Loading branch information
dmitryax authored Feb 13, 2024
1 parent 8991654 commit 001d6c3
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions receiver/scrapererror/partialscrapeerror.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ func NewPartialScrapeError(err error, failed int) PartialScrapeError {

// IsPartialScrapeError checks if an error was wrapped with PartialScrapeError.
func IsPartialScrapeError(err error) bool {
if err == nil {
return false
}

var partialScrapeErr PartialScrapeError
return errors.As(err, &partialScrapeErr)
}

0 comments on commit 001d6c3

Please sign in to comment.