Skip to content

Commit

Permalink
Use slices api
Browse files Browse the repository at this point in the history
Co-authored-by: Jordan Krage <[email protected]>
  • Loading branch information
reductionista and jmank88 authored Dec 5, 2023
1 parent c672a55 commit 57a6e90
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/types/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,7 @@ func grpcErrorHasTypeAndMessage(target error, msg string, code codes.Code) bool
}

errs := strings.Split(s.Message(), ":")
for _, err := range errs {
if strings.Trim(err, " ") == msg {
return true
}
return slices.ContainsFunc(errs, func(err error) bool {
return strings.Trim(err, " ") == msg
}

Check failure on line 81 in pkg/types/provider.go

View workflow job for this annotation

GitHub Actions / build-test

syntax error: unexpected newline in argument list; possibly missing comma or )

return false
}

0 comments on commit 57a6e90

Please sign in to comment.