[dead-code] chore: remove dead functions — 5 functions removed#25630
Merged
[dead-code] chore: remove dead functions — 5 functions removed#25630
Conversation
Remove unreachable functions identified by the deadcode static analyzer: - estimateTokens (pkg/cli/mcp_logs_guardrail.go) - WithSafeUpdate (pkg/workflow/compiler_types.go) - WithPriorManifest (pkg/workflow/compiler_types.go) - Compiler.SetPriorManifest (pkg/workflow/compiler_types.go) - marshalStringSliceJSON (pkg/workflow/publish_artifacts.go) Also remove exclusive test functions TestEstimateTokens and TestMarshalStringSliceJSON that only tested the deleted functions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Removes unreachable Go helpers and their now-obsolete unit tests as identified by the deadcode analyzer.
Changes:
- Deleted unused helper functions in
pkg/cliandpkg/workflow. - Removed now-unused imports resulting from the deletions.
- Removed unit tests that exclusively exercised the deleted helpers.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/publish_artifacts.go | Removes unused JSON helper and corresponding import. |
| pkg/workflow/publish_artifacts_test.go | Removes test that only covered the deleted helper. |
| pkg/workflow/compiler_types.go | Removes unused functional options / method related to prior manifests and safe-update option wiring. |
| pkg/cli/mcp_logs_guardrail.go | Removes unused token estimation helper. |
| pkg/cli/mcp_logs_guardrail_test.go | Removes test that only covered the deleted token estimation helper. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 0
This was referenced Apr 10, 2026
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
estimateTokenspkg/cli/mcp_logs_guardrail.goWithSafeUpdatepkg/workflow/compiler_types.goWithPriorManifestpkg/workflow/compiler_types.goCompiler.SetPriorManifestpkg/workflow/compiler_types.gomarshalStringSliceJSONpkg/workflow/publish_artifacts.goTests Removed
TestEstimateTokens— exclusively tested the deletedestimateTokensfunctionTestMarshalStringSliceJSON— exclusively tested the deletedmarshalStringSliceJSONfunctionVerification
go build ./...— passesgo vet ./...— passesgo vet -tags=integration ./...— passesmake fmt— no changes neededDead Function Count
WithSkipValidation,WithNoEmit,WithWorkflowIdentifier;CompileToYAML/ParseWorkflowStringconfirmed WASM-live)Automated by Dead Code Removal workflow — https://github.com/github/gh-aw/actions/runs/24241823810