Skip to content

Commit 35ffcef

Browse files
committed
match func doesn't need err anymore
1 parent 580826c commit 35ffcef

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Diff for: commands/core/search.go

+5-7
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ func PlatformSearch(req *rpc.PlatformSearchRequest) (*rpc.PlatformSearchResponse
4848

4949
searchArgs := strings.Split(searchArgs, " ")
5050

51-
match := func(toTest []string) (bool, error) {
51+
match := func(toTest []string) bool {
5252
if len(searchArgs) == 0 {
53-
return true, nil
53+
return true
5454
}
5555

5656
for _, t := range toTest {
5757
if utils.Match(t, searchArgs) {
58-
return true, nil
58+
return true
5959
}
6060
}
61-
return false, nil
61+
return false
6262
}
6363

6464
for _, targetPackage := range pm.Packages {
@@ -91,9 +91,7 @@ func PlatformSearch(req *rpc.PlatformSearchRequest) (*rpc.PlatformSearchResponse
9191
}
9292

9393
// Search
94-
if ok, err := match(toTest); err != nil {
95-
return nil, err
96-
} else if !ok {
94+
if !match(toTest) {
9795
continue
9896
}
9997

0 commit comments

Comments
 (0)