webhooks: improve usage of slices.Contains This was (rightfully) suggested by modernize [1], but the result can be easily improved even further. [1] https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize
1 files changed, 1 insertions(+), 5 deletions(-) M webhooks/legacy.go
M webhooks/legacy.go => webhooks/legacy.go +1 -5
@@ 134,11 134,7 @@ func fetchSubscriptions(ctx context.Context, q sq.SelectBuilder, // double check here to get the final list. sub.Events = strings.Split(events, ",") var valid bool if slices.Contains(sub.Events, event) { valid = true } valid := slices.Contains(sub.Events, event) if valid { subs = append(subs, &sub) }