The most impactful refactoring in a Go CLI wasn't adding code — it was deleting pass-through layers, thin wrappers, and premature frameworks. Here's how to recognize abstractions that cost more than they save.
Over 60 refactorings on a security CLI, the highest-ROI changes were deletions. Deletions of abstractions that existed "just in case" and cost every reader cognitive overhead with zero runtime benefit.
Here are the abstractions we removed and why.
1. Pass-through packages
A package that exists only to forward calls to another package:
// internal/app/workflow/evaluate.go package workflow
func Evaluate ( input EvalInput ) ( Result , error ) { return eval . Evaluate ( input ) // just forwards }
Enter fullscreen mode
Exit fullscreen mode
Every command imported workflow instead of eval directly. The package had no logic, no transformation, no error handling.…