diff --git a/ginkgo/command/program.go b/ginkgo/command/program.go index 88dd8d6b07..c3f6d3a11e 100644 --- a/ginkgo/command/program.go +++ b/ginkgo/command/program.go @@ -68,7 +68,6 @@ func (p Program) RunAndExit(osArgs []string) { fmt.Fprintln(p.ErrWriter, deprecationTracker.DeprecationsReport()) } p.Exiter(exitCode) - return }() args, additionalArgs := []string{}, []string{} @@ -157,7 +156,6 @@ func (p Program) handleHelpRequestsAndExit(writer io.Writer, args []string) { p.EmitUsage(writer) Abort(AbortDetails{ExitCode: 1}) } - return } func (p Program) EmitUsage(writer io.Writer) { diff --git a/ginkgo/internal/gocovmerge.go b/ginkgo/internal/gocovmerge.go index 3c5079ff4c..87cfa11194 100644 --- a/ginkgo/internal/gocovmerge.go +++ b/ginkgo/internal/gocovmerge.go @@ -89,7 +89,7 @@ func mergeProfileBlock(p *cover.Profile, pb cover.ProfileBlock, startIndex int) } i := 0 - if sortFunc(i) != true { + if !sortFunc(i) { i = sort.Search(len(p.Blocks)-startIndex, sortFunc) } diff --git a/ginkgo/run/run_command.go b/ginkgo/run/run_command.go index aaed4d570e..b7d77390bb 100644 --- a/ginkgo/run/run_command.go +++ b/ginkgo/run/run_command.go @@ -142,7 +142,7 @@ OUTER_LOOP: } if !endTime.IsZero() { - r.suiteConfig.Timeout = endTime.Sub(time.Now()) + r.suiteConfig.Timeout = time.Until(endTime) if r.suiteConfig.Timeout <= 0 { suites[suiteIdx].State = internal.TestSuiteStateFailedDueToTimeout opc.StopAndDrain() diff --git a/internal/internal_integration/progress_report_test.go b/internal/internal_integration/progress_report_test.go index 742227bcfc..6d271e9283 100644 --- a/internal/internal_integration/progress_report_test.go +++ b/internal/internal_integration/progress_report_test.go @@ -241,7 +241,7 @@ var _ = Describe("Progress Reporting", func() { Describe("a container", func() { It("A", func() { cl = types.NewCodeLocation(0) - c := make(chan bool, 0) + c := make(chan bool) go func() { c <- true <-c diff --git a/internal/parallel_support/http_client.go b/internal/parallel_support/http_client.go index 6547c7a66e..2e7d003074 100644 --- a/internal/parallel_support/http_client.go +++ b/internal/parallel_support/http_client.go @@ -153,10 +153,7 @@ func (client *httpClient) PostAbort() error { func (client *httpClient) ShouldAbort() bool { err := client.poll("/abort", nil) - if err == ErrorGone { - return true - } - return false + return err == ErrorGone } func (client *httpClient) Write(p []byte) (int, error) { diff --git a/types/label_filter.go b/types/label_filter.go index 7fdc8aa23f..40a909b6d5 100644 --- a/types/label_filter.go +++ b/types/label_filter.go @@ -343,7 +343,7 @@ func tokenize(input string) func() (*treeNode, error) { consumeUntil := func(cutset string) (string, int) { j := i for ; j < len(runes); j++ { - if strings.IndexRune(cutset, runes[j]) >= 0 { + if strings.ContainsRune(cutset, runes[j]) { break } }