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

Function optional

script/ghmock/introspection.go:409–414  ·  view source on GitHub ↗

optional turns an empty description into null, as GitHub returns it.

(text string)

Source from the content-addressed store, hash-verified

407
408// optional turns an empty description into null, as GitHub returns it.
409func optional(text string) any {
410 if text == "" {
411 return nil
412 }
413 return text
414}

Callers 6

resolveMethod · 0.85
resolveMethod · 0.85
resolveMethod · 0.85
resolveMethod · 0.85
resolveMethod · 0.85
resolveMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected