1
0
mirror of https://github.com/golang/go synced 2024-11-12 01:50:22 -07:00

go cmd: print more than one error when running go test

Fixes #3055.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5683079
This commit is contained in:
Robert Griesemer 2012-02-22 22:33:45 -08:00
parent b05e3f11b1
commit 548591b77d

View File

@ -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
}