Skip to content

Commit

Permalink
Merge pull request #146 from dnephin/remove-type-assert-for-pre-go1.12
Browse files Browse the repository at this point in the history
Move ExitError type check to test file.
  • Loading branch information
dnephin committed Sep 1, 2020
2 parents 7a46c48 + 78884b8 commit 4bafc65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 0 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,5 +390,3 @@ func exitCodeWithDefault(err error) int {
type exitCoder interface {
ExitCode() int
}

var _ exitCoder = &exec.ExitError{}
5 changes: 5 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"bytes"
"os"
"os/exec"
"strings"
"testing"

Expand Down Expand Up @@ -356,3 +357,7 @@ func TestRun_RerunFails_BuildErrorPreventsRerun(t *testing.T) {
err := run(opts)
assert.ErrorContains(t, err, "rerun aborted because previous run had errors", out.String())
}

// type checking of os/exec.ExitError is done in a test file so that users
// installing from source can continue to use versions prior to go1.12.
var _ exitCoder = &exec.ExitError{}

0 comments on commit 4bafc65

Please sign in to comment.