rtk-ai/rtk

go build: reports "Success" when build fails with unrecognized error

Open

#1599 opened on Apr 29, 2026

View on GitHub
 (1 comment) (1 reaction) (0 assignees)Rust (48,085 stars) (2,914 forks)batch import
bugeffort-smallfilter-qualitygood first issue

Description

Bug

rtk go build reports "Go build: Success" when the underlying go build command fails with an unrecognized error. The exit code is correctly propagated as 1, but the filtered output says "Success", which is misleading.

Reproduction

# From any Go project root:
rtk go build -o /tmp/test ./cmd/nonexistent
# Output: "Go build: Success"
# Exit code: 1
# Binary: not created

# Bypass filter to see real error:
rtk proxy go build -o /tmp/test ./cmd/nonexistent
# Output: "stat .../cmd/nonexistent: directory not found"
# Exit code: 1

Root Cause

filter_go_build() in src/cmds/go/go_cmd.rs determines success/failure by scanning output for known error patterns via is_go_build_error_line(). When no patterns match, it returns "Go build: Success" — even if the output contains unrecognized error text.

The error stat ...: directory not found doesn't match any of the recognized patterns (.go: locations, go.mod: errors, undefined: prefixes, etc.), so it's silently dropped and the filter reports success.

Expected Behavior

When go build produces output that doesn't match any known progress/download pattern and doesn't match any known error pattern, the output should be passed through as a failure rather than swallowed.

A truly successful go build produces no output (or only go: downloading ... progress lines). Any other unrecognized output indicates an error the filter doesn't understand.

Contributor guide