Junior · Go with coding agents

Use an agent without outsourcing understanding

How would you use Claude Code, Codex or Cursor for a Go change?

Try explaining this aloud before opening the answer. State your assumptions and trace a boundary case.

Reveal a strong answer
  1. State the observable behavior, constraints, repository scope and a concrete check. Ask the tool to inspect the relevant implementation before editing, and give a small example of expected and failing behavior.

  2. Keep the change reviewable: one coherent task, explicit dependency policy and the actual test command. An agent can propose code and run tools, but you still need to understand invariants, failure modes and the diff.

  3. Evaluate evidence: inspect changed files, run the meaningful tests/build and review error handling and ownership. Product features and defaults evolve; check the official documentation for the installed tool instead of copying stale flags or assuming every agent has the same permissions.

Common trap

“It says all tests passed” is not evidence unless the actual command, output and relevant assertions were checked.

Try it

Prompt an agent to fix LowerBound returning an arbitrary duplicate index.

Worked solution

Give [1,3,3,8], target3, expected1; require preserving the public API and half-open invariant, add empty/missing boundary cases, run the package tests and inspect the diff. Ask it to explain why equality narrows hi instead of returning immediately.

Change the constraint

What would you do if the agent edits an unrelated failing test to make the suite pass?

How did you do?

Self-assessment, not a compiler pass or interview score. Explain the reasoning unaided before marking understood.

Not marked. Progress stays on this browser, separate from course completion.

Primary references

Checked 2026-10-20. Use documentation for your pinned runtime, driver and tool version.