Skip to content

dev/sg: do not overwrite existing std.Out on failure

Warren Gifford requested to merge stdout-followup into main

Created by: bobheadxi

This is a follow-up to the patch in https://github.com/sourcegraph/sourcegraph/pull/37406

Most notably in disable-output-detection, this configures a custom std.Out that should not be overwritten when writing a failure message. The scenario described in https://github.com/sourcegraph/sourcegraph/pull/37406 only happens when the error occurs before std.Out instantiation, which happens very early in the process, so in most cases std.Out will be set.

Test plan

go run ./dev/sg -disable-analytics=false start with a panic() at various points in Before (before output and after output instantiaton)

Merge request reports

Loading