MCPcopy Create free account
hub / github.com/cli/cli / NormalizeEventTypes

Function NormalizeEventTypes

pkg/cmd/event/shared/subscription.go:24–34  ·  view source on GitHub ↗

NormalizeEventTypes drops blank and duplicate event types, which the API rejects.

(names []string)

Source from the content-addressed store, hash-verified

22
23// NormalizeEventTypes drops blank and duplicate event types, which the API rejects.
24func NormalizeEventTypes(names []string) []string {
25 var types []string
26 for _, name := range names {
27 name = strings.TrimSpace(name)
28 if name == "" || slices.Contains(types, name) {
29 continue
30 }
31 types = append(types, name)
32 }
33 return types
34}
35
36// SubscriptionNotFoundError reports a subscription the API did not find. The API does not tell a missing
37// subscription apart from an expired, deleted, or another account's one.

Callers 2

createRunFunction · 0.92
listenRunFunction · 0.92

Calls 1

ContainsMethod · 0.80

Tested by

no test coverage detected