Conversation
Remove 3 unreachable functions identified by the deadcode static analyzer: - isGHESInstance - getGHESAPIURL - getGHESAllowedDomains These functions were never called from any production entry point. Their exclusive test file (git_ghes_test.go) is also removed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
pelikhan
approved these changes
Mar 15, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Removes unused GitHub Enterprise Server (GHES) helper logic and its dedicated tests after being flagged as unreachable by the deadcode analyzer.
Changes:
- Deleted three unused GHES helper functions from
pkg/cli/git.go. - Removed
pkg/cli/git_ghes_test.go, which only tested the deleted helpers.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/cli/git.go | Removes dead GHES helper functions that were not referenced anywhere in the codebase. |
| pkg/cli/git_ghes_test.go | Deletes tests that exclusively covered the removed dead code. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dead Code Removal
This PR removes unreachable Go functions identified by the
deadcodestatic analyzer.Functions Removed
isGHESInstancepkg/cli/git.gogetGHESAPIURLpkg/cli/git.gogetGHESAllowedDomainspkg/cli/git.goThese three GHES (GitHub Enterprise Server) helper functions were never called from any production entry point. They were planned utilities for GHES-specific behavior (auto-configuring api-target and network firewall domains) but were never wired into any command.
Tests Removed
pkg/cli/git_ghes_test.go— this file exclusively tested the three deleted functions (TestIsGHESInstance,TestGetGHESAPIURL,TestGetGHESAllowedDomains) and has been removed entirely.Verification
go build ./...— passesgo vet ./...— passesgo vet -tags=integration ./...— passesmake fmt— no changes neededDead Function Count
Automated by Dead Code Removal workflow — https://github.com/github/gh-aw/actions/runs/23116003697