Skip to content

[dead-code] chore: remove dead functions — 3 functions removed#21100

Merged
pelikhan merged 1 commit intomainfrom
dead-code/remove-ghes-functions-20260315-6d6e640ebb939e84
Mar 15, 2026
Merged

[dead-code] chore: remove dead functions — 3 functions removed#21100
pelikhan merged 1 commit intomainfrom
dead-code/remove-ghes-functions-20260315-6d6e640ebb939e84

Conversation

@github-actions
Copy link
Contributor

Dead Code Removal

This PR removes unreachable Go functions identified by the deadcode static analyzer.

Functions Removed

Function File
isGHESInstance pkg/cli/git.go
getGHESAPIURL pkg/cli/git.go
getGHESAllowedDomains pkg/cli/git.go

These 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 ./... — passes
  • go vet ./... — passes
  • go vet -tags=integration ./... — passes
  • make fmt — no changes needed

Dead Function Count

  • Before this batch: ~19 functions (excluding mandatory skips)
  • Removed in this PR: 3 functions
  • Remaining: ~16 functions

Automated by Dead Code Removal workflow — https://github.com/github/gh-aw/actions/runs/23116003697

Generated by Dead Code Removal Agent ·

  • expires on Mar 18, 2026, 6:06 PM UTC

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 pelikhan marked this pull request as ready for review March 15, 2026 19:06
Copilot AI review requested due to automatic review settings March 15, 2026 19:06
@pelikhan pelikhan merged commit 507478d into main Mar 15, 2026
@pelikhan pelikhan deleted the dead-code/remove-ghes-functions-20260315-6d6e640ebb939e84 branch March 15, 2026 19:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants