Skip to content

Commit 62bfbd0

Browse files
committed
fix: remove unused struct wrapper
1 parent 2554a0b commit 62bfbd0

3 files changed

Lines changed: 3 additions & 15 deletions

File tree

cmd/main.go

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ func defaultNoColor() bool {
236236
// try to detect these CI environments via their environment variables.
237237
// This code is based on https://github.com/jwalton/go-supportscolor
238238
if value, exists := os.LookupEnv("CI"); exists {
239-
var ciEnvNames = []string{
239+
ciEnvNames := []string{
240240
"APPVEYOR",
241241
"BUILDKITE",
242242
"CIRCLECI",
@@ -468,7 +468,6 @@ func startGoTest(ctx context.Context, dir string, args []string) (*proc, error)
468468
log.Debugf("go test pid: %d", cmd.Process.Pid)
469469

470470
newSignalHandler(ctx, cmd.Process.Pid, &p)
471-
p.cmd = &cancelWaiter{wrapped: p.cmd}
472471
return &p, nil
473472
}
474473

@@ -529,14 +528,3 @@ func newSignalHandler(ctx context.Context, pid int, p *proc) {
529528
}
530529
}()
531530
}
532-
533-
// cancelWaiter wraps a waiter to cancel the context after the wrapped
534-
// Wait exits.
535-
type cancelWaiter struct {
536-
wrapped waiter
537-
}
538-
539-
func (w *cancelWaiter) Wait() error {
540-
err := w.wrapped.Wait()
541-
return err
542-
}

cmd/main_e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func TestE2E_RerunFails(t *testing.T) {
7979
)
8080
golden.Assert(t, out, "e2e/expected/"+expectedFilename(t.Name()))
8181
}
82-
var testCases = []testCase{
82+
testCases := []testCase{
8383
{
8484
name: "reruns until success",
8585
args: []string{

cmd/rerunfails_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func TestGoTestRunFlagFromTestCases(t *testing.T) {
6868
assert.Equal(t, actual, tc.expected)
6969
}
7070

71-
var testCases = map[string]testCase{
71+
testCases := map[string]testCase{
7272
"root test case": {
7373
input: "TestOne",
7474
expected: "-test.run=^TestOne$",

0 commit comments

Comments
 (0)