From 548591b77d115a557e8e6351b78b96831002b306 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 22 Feb 2012 22:33:45 -0800 Subject: [PATCH] go cmd: print more than one error when running go test Fixes #3055. R=rsc, r CC=golang-dev https://golang.org/cl/5683079 --- src/cmd/go/test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/cmd/go/test.go b/src/cmd/go/test.go index 57cdc7696a..26b71fec1c 100644 --- a/src/cmd/go/test.go +++ b/src/cmd/go/test.go @@ -11,6 +11,7 @@ import ( "go/build" "go/doc" "go/parser" + "go/scanner" "go/token" "os" "os/exec" @@ -299,6 +300,16 @@ func runTest(cmd *Command, args []string) { for _, p := range pkgs { buildTest, runTest, printTest, err := b.test(p) if err != nil { + if list, ok := err.(scanner.ErrorList); ok { + const n = 10 + if len(list) > n { + list = list[:n] + } + for _, err := range list { + errorf("%s", err) + } + continue + } errorf("%s", err) continue } -- 2.48.1