JetbrainsDominika StankiewiczTutorial
JetBrains Air in GoLand: Build, Review, and Profile Go Code With Agents
Summary
The post demonstrates using JetBrains Air in GoLand to build a webhook receiver service with AI agents. It starts with a brief defining the service: a single POST endpoint that stores events idempotently with signature verification. The author uses Codex to generate the core service, then reviews the diff against known security pitfalls like constant-time comparison and replay windows. Three follow-up tasks run in parallel worktrees: an SQLite store, additional tests, and signed test requests. After merging, the service is profiled using a new goland-profiler skill, which reveals regexp.MustCompile as a bottleneck. Moving the compilation to package level yields a 4.6x speedup with 59% fewer bytes per request.
Context
The post demonstrates how to build a reliable webhook handler service in Go using AI agents while maintaining code ownership. It addresses the challenge of ensuring agent-generated code is correct by providing a review checklist and using JetBrains Air’s features for diff review, parallel worktrees, and profiling.
Approach / What changed
Using JetBrains Air in GoLand to orchestrate AI agents (Codex, Claude Code, Junie) via the Agent Client Protocol. The workflow includes: defining a project brief, generating code with an agent, reviewing diffs with inline feedback, running parallel tasks in separate worktrees, merging changes, and profiling the service with the goland-profiler skill to identify and fix performance bottlenecks.
Takeaways
JetBrains Air in GoLand 2026.3 supports multiple agents (Codex, Claude Code, Junie) via the Agent Client Protocol, allowing developers to choose their preferred agent for code generation tasks.
Reviewing agent-generated code against a checklist of known security pitfalls (constant-time comparison, raw body HMAC, replay window, size limit, read-once body, idempotent replies, quiet errors) helps catch mistakes before production.
The goland-profiler skill can profile a running Go service, capture a CPU profile, and suggest optimizations; in the demo, moving regexp.MustCompile to package level improved benchmark time per request from 13,141 ns to 2,748 ns.
FAQ
How do you start an Air session in GoLand?
Click the Agent widget in the main toolbar, use the Agent Sessions tool window (View | Tool Windows | Agent Sessions), or press Ctrl twice anywhere in the IDE and type your request. Each session opens in its own tab with options for model, effort, and access level.
What security checks should you apply to agent-generated webhook code?
Check for constant-time comparison (hmac.Equal), raw body HMAC, replay window (reject stale timestamps), size limit (http.MaxBytesReader), read-once body (restore r.Body), idempotent replies (200 OK for duplicates), and quiet error responses (short fixed messages, details in logs).
How does the goland-profiler skill work?
The agent starts the service, runs a load test, captures a CPU profile, and opens it in the Go Optimization tool window. The profile shows bottlenecks like regexp.MustCompile, which can be fixed by compiling once at package level, yielding a 4.6x speedup with 59% fewer bytes per request.
Source and freshness
- Source
- blog.jetbrains.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.