From 2d1dd4372211f6f9bcdc6a3e4623b5fd10cebdbf Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Mon, 14 Feb 2022 13:23:30 -0800 Subject: [PATCH] cmd/go: enable file shortening for lines starting with \t MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compiler errors now (as of 1.18) might start with a tab character, for errors which take multiple lines to report. e.g.: /Users/khr/gowork/tmp1.go:3:15: x redeclared in this block /Users/khr/gowork/tmp1.go:3:8: other declaration of x This CL makes error lines starting with a tab character eligible for replacing absolute paths with relative ones. Fixes #51177 Change-Id: Ic9e9c610a1aa1e21e9f19e6a9bd05c73b5a14e4a Reviewed-on: https://go-review.googlesource.com/c/go/+/385755 Trust: Keith Randall Run-TryBot: Keith Randall Reviewed-by: Daniel Martí Trust: Daniel Martí TryBot-Result: Gopher Robot --- src/cmd/go/internal/work/exec.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go index 48a74458bda..ac80f503cd8 100644 --- a/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go @@ -2013,6 +2013,7 @@ func (b *Builder) showOutput(a *Action, dir, desc, out string) { if reldir := base.ShortPath(dir); reldir != dir { suffix = strings.ReplaceAll(suffix, " "+dir, " "+reldir) suffix = strings.ReplaceAll(suffix, "\n"+dir, "\n"+reldir) + suffix = strings.ReplaceAll(suffix, "\n\t"+dir, "\n\t"+reldir) } suffix = strings.ReplaceAll(suffix, " "+b.WorkDir, " $WORK")