Remove unnecessary code branches

This commit is contained in:
Tyler McGoffin 2024-10-15 12:35:35 -07:00
parent e1a39d8e2b
commit 0bd4e034ef

View file

@ -47,13 +47,6 @@ func GraphQLEndpoint(hostname string) string {
if isGarage(hostname) {
return fmt.Sprintf("https://%s/api/graphql", hostname)
}
// Once we change Tenancy to no longer be treated as Enterprise, this
// conditional can be removed as the flow will fall through to the bottom.
// However, we can't do that until we've investigated all places in which
// Tenancy is currently treated as Enterprise.
if ghauth.IsTenancy(hostname) {
return fmt.Sprintf("https://api.%s/graphql", hostname)
}
if ghauth.IsEnterprise(hostname) {
return fmt.Sprintf("https://%s/api/graphql", hostname)
}
@ -67,13 +60,6 @@ func RESTPrefix(hostname string) string {
if isGarage(hostname) {
return fmt.Sprintf("https://%s/api/v3/", hostname)
}
// Once we change Tenancy to no longer be treated as Enterprise, this
// conditional can be removed as the flow will fall through to the bottom.
// However, we can't do that until we've investigated all places in which
// Tenancy is currently treated as Enterprise.
if ghauth.IsTenancy(hostname) {
return fmt.Sprintf("https://api.%s/", hostname)
}
if ghauth.IsEnterprise(hostname) {
return fmt.Sprintf("https://%s/api/v3/", hostname)
}