Skip to content

Commit

Permalink
Add another go module prefix to the list
Browse files Browse the repository at this point in the history
  • Loading branch information
dnephin committed Nov 3, 2018
1 parent a449359 commit 3652484
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions testjson/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,15 @@ func readStdout(config ScanConfig, execution *Execution) error {
event, err := parseEvent(raw)
switch {
case err == errBadEvent:
// nolint: errcheck
config.Handler.Err(errBadEvent.Error() + ": " + scanner.Text())
continue
case err != nil:
return errors.Wrapf(err, "failed to parse test output: %s", string(raw))
}
execution.add(event)
if err := config.Handler.Event(event, execution); err != nil {
return err
return err
}
}
return errors.Wrap(scanner.Err(), "failed to scan test output")
Expand All @@ -317,7 +318,7 @@ func readStderr(config ScanConfig, execution *Execution) error {
scanner := bufio.NewScanner(config.Stderr)
for scanner.Scan() {
line := scanner.Text()
config.Handler.Err(line)
config.Handler.Err(line) // nolint: errcheck
if isGoModuleOutput(line) {
continue
}
Expand All @@ -327,7 +328,11 @@ func readStderr(config ScanConfig, execution *Execution) error {
}

func isGoModuleOutput(scannerText string) bool {
prefixes := [2]string{"go: extracting", "go: downloading"}
prefixes := []string{
"go: extracting",
"go: downloading",
"go: finding",
}

for _, prefix := range prefixes {
if strings.HasPrefix(scannerText, prefix) {
Expand Down

0 comments on commit 3652484

Please sign in to comment.