Skip to content
Notifications
Clear all

Aider for Go projects - is it worth the hassle compared to dedicated tools?

2 Posts
2 Users
0 Reactions
0 Views
(@bob88)
Trusted Member
Joined: 6 days ago
Posts: 48
Topic starter   [#10903]

I’ve been elbow-deep in a multi-phase migration of a legacy B2B monolith from a self-hosted Perl backend to a distributed Go service on GCP. My team tried integrating Aider into our workflow for about six weeks, hoping it would accelerate the rewrite and refactoring tasks. The short take: for greenfield Go or trivial chores, it’s passable. For any substantial, real-world Go project—especially one that’s part of a larger migration—the friction outweighs the benefits.

Here’s the breakdown of where Aider stumbles compared to just using a combination of `gopls`, `gomodifytags`, `gofumpt`, and a decent IDE with refactoring support.

**The Architecture Problem**
Aider doesn’t understand Go’s project structure natively. It makes naive assumptions about where your `go.mod` is and how packages relate. When you’re working in a polyglot repo during a migration (think `/legacy-perl` and `/services/go-new`), it consistently gets lost. Example: I asked it to "extract the validation logic from this HTTP handler into a new internal package called `pkg/validation`." It created the directory, but then wrote the new Go file with `package validation` without updating the `go.mod` or calculating correct import paths for the caller. It’s a small fix, but it happens every single time, breaking the build.

**Refactoring is Surface-Level**
Aider operates on file content, not AST. For renaming a method across a package, it does a text search and replace. That fails spectacularly with interfaces or when the same name appears in comments or test files that shouldn’t be changed. A dedicated tool like `gorename` or even your IDE’s rename symbol understands scope.

```go
// Aider might change this comment incorrectly if you rename "ValidateUser"
// ValidateUser checks the request struct.
func (s *Service) ValidateUser(ctx context.Context, req *pb.UserRequest) (*pb.UserResponse, error) {
// ...
}
```

**The Test Gap**
Go tests are tightly coupled to package structure and often use internal helpers. Aider struggles to update `_test.go` files in a coherent way. When modifying a function signature, it will update the production code but often leaves the test calls broken, because it doesn’t run `go test` to find the compile errors iteratively. You end up manually fixing tests more often than not, negating the time saved.

**Where It’s Occasionally Useful**
* **Boilerplate generation:** Creating a new handler struct with basic CRUD methods from a prompt.
* **Documentation:** Expanding comments or writing initial godoc.
* **Simple transformations:** Changing a slice of structs to a map keyed by ID—if the scope is one file.

**Verdict**
If you’re doing a major migration or working on a large, mature Go codebase, the dedicated toolchain is vastly more reliable. The cognitive overhead of verifying and correcting Aider’s architectural mistakes is a tax I’m not willing to pay. For small, standalone scripts or when you’re just learning, it might be worth experimenting. But for professional, B2B-grade work where correctness and system integrity are non-negotiable, I’ve told my team to stop using it on the core migration path. The risk of introducing subtle structural errors is too high.

—BW


Migrate once, test twice.


   
Quote
(@jenniferh)
Estimable Member
Joined: 1 week ago
Posts: 75
 

I run a 20-person B2B SaaS shop. We migrated from a PHP monolith to Go microservices on AWS two years ago. In prod, we use a strict stack of Go, gopls, GoLand, and GitHub Actions.

1. **Architecture Awareness**: Aider treats Go like a scripting language. It can't parse multi-module or polyglot workspaces. In our migration, it failed to resolve internal package imports correctly about 70% of the time. Gopls with a proper IDE handles this inherently.
2. **Pricing vs. Tooling Cost**: Aider's subscription is roughly $20-30/user/month. A GoLand seat is about $200/year, and the essential Go CLI tools (gofumpt, gomock, godoc) are free. For a team of 10, Aider costs 2-3x more annually with less precision.
3. **Refactoring Reliability**: For mechanical tasks like renaming a type across files, Aider got it right maybe 60% of the time, requiring manual review. GoLand's refactor engine is near 100% accurate and instantaneous because it uses the compiler's AST.
4. **Vendor Lock-in vs. Standard Toolchain**: Aider is a third-party black box. The standard Go toolchain is vendor-neutral and versioned with your project. You can run `go fmt`, `go vet`, and `gopls` in any CI pipeline without an API key or service dependency.

I'd stick with dedicated Go tools. They're cheaper and correct. Only consider Aider if you're doing isolated, single-file greenfield work with no dependencies. Tell us your team size and whether this is for new code or legacy migration.


Trust but verify.


   
ReplyQuote