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

Function enumPlaceholder

script/ghmock/gqlscaffold.go:28–40  ·  view source on GitHub ↗
(values []string)

Source from the content-addressed store, hash-verified

26var preferredEnumValues = []string{"OPEN", "PUBLIC", "CLEAN", "MERGEABLE", "SUCCESS"}
27
28func enumPlaceholder(values []string) string {
29 for _, want := range preferredEnumValues {
30 for _, v := range values {
31 if strings.EqualFold(v, want) {
32 return v
33 }
34 }
35 }
36 if len(values) == 0 {
37 return ""
38 }
39 return values[0]
40}
41
42// gqlScaffolder builds a GraphQL response for a query, or adds the fields that
43// a stored response lacks. It never changes a value that's already there.

Callers 2

generateMethod · 0.85
generateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected