MCPcopy Index your code
hub / github.com/cli/cli / IsOfficial

Function IsOfficial

pkg/extensions/official.go:43–53  ·  view source on GitHub ↗

IsOfficial reports whether the given extension command name and owner match an entry in the OfficialExtensions registry. Owner must be checked alongside name because a user may have installed a third-party extension that happens to share a name with one of ours (e.g. `someuser/gh-stack` predates `gi

(name, owner string)

Source from the content-addressed store, hash-verified

41// is case-insensitive because GitHub usernames and organization names
42// are themselves case-insensitive.
43func IsOfficial(name, owner string) bool {
44 if owner == "" {
45 return false
46 }
47 for _, ext := range OfficialExtensions {
48 if ext.Name == name && strings.EqualFold(ext.Owner, owner) {
49 return true
50 }
51 }
52 return false
53}

Callers 2

NewCmdExtensionFunction · 0.92
TestIsOfficialFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestIsOfficialFunction · 0.68