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)
| 41 | // is case-insensitive because GitHub usernames and organization names |
| 42 | // are themselves case-insensitive. |
| 43 | func 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 | } |
no outgoing calls