From 8d04841c2a216eee742f24307d9f74758e64bb93 Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Wed, 10 Apr 2024 08:18:48 -0400 Subject: [PATCH] Document newly exported functions --- pkg/auth/auth.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/auth/auth.go b/pkg/auth/auth.go index eb4236a..6ab996f 100644 --- a/pkg/auth/auth.go +++ b/pkg/auth/auth.go @@ -152,11 +152,15 @@ func defaultHost(cfg *config.Config) (string, string) { // TenancyHost is the domain name of a tenancy GitHub instance. const tenancyHost = "ghe.com" +// IsEnterprise determines if a provided host is a GitHub Enterprise Server instance, +// rather than GitHub.com or a tenancy GitHub instance. func IsEnterprise(host string) bool { normalizedHost := normalizeHostname(host) return normalizedHost != github && normalizedHost != localhost && !IsTenancy(normalizedHost) } +// IsTenancy determines if a provided host is a tenancy GitHub instance, +// rather than GitHub.com or a GitHub Enterprise Server instance. func IsTenancy(host string) bool { normalizedHost := normalizeHostname(host) return strings.HasSuffix(normalizedHost, "."+tenancyHost)