Skip to content

Add Go as a supported output language#1

Open
jarsh921 wants to merge 4 commits into
mainfrom
add-go-output-language
Open

Add Go as a supported output language#1
jarsh921 wants to merge 4 commits into
mainfrom
add-go-output-language

Conversation

@jarsh921

Copy link
Copy Markdown
Owner

No description provided.

Joshua Dunbar added 2 commits July 21, 2026 14:21
Follows the exact same pattern as python/javascript/typescript:

- New prompt partial (prompts/partials/_language_go.md): prefer the
  standard library (net/http, encoding/json) over third-party deps,
  reuse one http.Client across requests, hardcode auth found in the
  traffic (cookies via the client's cookie jar, tokens/API keys in
  headers) with the same auth-refresh-on-401/403 guidance the other
  languages already have, and the same three-tier bot-detection
  fallback (httpcloak -> Playwright CDP -> full browser automation).
- base_engineer.py: added "go" to _OUTPUT_LANGUAGE_EXTENSIONS (.go),
  _get_language_name() ("Go"), _get_run_command() ("go run
  api_client.go"), and _get_auto_output_files() (go.mod/go.sum,
  conditional on external deps being needed - same posture as
  javascript's package.json entry, since net/http-only Go code needs
  neither).
- cli.py: added Go to the interactive `output_language` config picker.
- Updated the three docstrings/comments that listed the language set
  (config.py, engineer.py, prompts/__init__.py) and README.md's output
  language line.
- Tests: mirrored the existing per-language test pattern in
  test_base_engineer.py (extension, run command, prompt content) and
  test_prompts.py (partial loading) for Go.

Full test suite passes (49/49 in the touched files; the 4 failures
elsewhere are pre-existing on main, unrelated to this change - TTY
detection and a Windows path-separator assertion). ruff check is clean
on every file this touches (8 pre-existing lint errors elsewhere on
main, none in the touched lines).
@jarsh921
jarsh921 force-pushed the add-go-output-language branch from 80abc60 to 30b8dee Compare July 21, 2026 18:22
Joshua Dunbar and others added 2 commits July 21, 2026 15:05
Flagged independently by two review bots (greptile-apps, cubic-dev-ai)
on the PR: the partial's first bullet told the model the default was
a single "main.go", but the actual save path
({scripts_dir}/{client_filename}) and run command (go run
api_client.go) both resolve to api_client.go - if the model had
followed the main.go instruction literally, the run command would
fail to find the file it just wrote. Replaced the specific (wrong)
filename with a generic "single-file program" description, matching
how the Java/C# partials already describe their own output files
without hardcoding a filename that could drift from the real one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants