Skip to content

Commit

Permalink
Fix slices.ContainsFunc
Browse files Browse the repository at this point in the history
  • Loading branch information
reductionista committed Dec 5, 2023
1 parent 57a6e90 commit 2e62afe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/types/provider.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package types

import (
"slices"
"strings"

ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types"
Expand Down Expand Up @@ -76,7 +77,7 @@ func grpcErrorHasTypeAndMessage(target error, msg string, code codes.Code) bool
}

errs := strings.Split(s.Message(), ":")
return slices.ContainsFunc(errs, func(err error) bool {
return strings.Trim(err, " ") == msg
}
return slices.ContainsFunc(errs, func(err string) bool {
return strings.Trim(err, " ") == msg
})
}

0 comments on commit 2e62afe

Please sign in to comment.