Skip to content

Commit aee0d56

Browse files
authoredJan 2, 2025··
Code linting (#1500)
1 parent 809a710 commit aee0d56

File tree

6 files changed

+5
-10
lines changed

6 files changed

+5
-10
lines changed
 

‎ginkgo/command/program.go

-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ func (p Program) RunAndExit(osArgs []string) {
6868
fmt.Fprintln(p.ErrWriter, deprecationTracker.DeprecationsReport())
6969
}
7070
p.Exiter(exitCode)
71-
return
7271
}()
7372

7473
args, additionalArgs := []string{}, []string{}
@@ -157,7 +156,6 @@ func (p Program) handleHelpRequestsAndExit(writer io.Writer, args []string) {
157156
p.EmitUsage(writer)
158157
Abort(AbortDetails{ExitCode: 1})
159158
}
160-
return
161159
}
162160

163161
func (p Program) EmitUsage(writer io.Writer) {

‎ginkgo/internal/gocovmerge.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func mergeProfileBlock(p *cover.Profile, pb cover.ProfileBlock, startIndex int)
8989
}
9090

9191
i := 0
92-
if sortFunc(i) != true {
92+
if !sortFunc(i) {
9393
i = sort.Search(len(p.Blocks)-startIndex, sortFunc)
9494
}
9595

‎ginkgo/run/run_command.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ OUTER_LOOP:
142142
}
143143

144144
if !endTime.IsZero() {
145-
r.suiteConfig.Timeout = endTime.Sub(time.Now())
145+
r.suiteConfig.Timeout = time.Until(endTime)
146146
if r.suiteConfig.Timeout <= 0 {
147147
suites[suiteIdx].State = internal.TestSuiteStateFailedDueToTimeout
148148
opc.StopAndDrain()

‎internal/internal_integration/progress_report_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ var _ = Describe("Progress Reporting", func() {
241241
Describe("a container", func() {
242242
It("A", func() {
243243
cl = types.NewCodeLocation(0)
244-
c := make(chan bool, 0)
244+
c := make(chan bool)
245245
go func() {
246246
c <- true
247247
<-c

‎internal/parallel_support/http_client.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,7 @@ func (client *httpClient) PostAbort() error {
153153

154154
func (client *httpClient) ShouldAbort() bool {
155155
err := client.poll("/abort", nil)
156-
if err == ErrorGone {
157-
return true
158-
}
159-
return false
156+
return err == ErrorGone
160157
}
161158

162159
func (client *httpClient) Write(p []byte) (int, error) {

‎types/label_filter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ func tokenize(input string) func() (*treeNode, error) {
343343
consumeUntil := func(cutset string) (string, int) {
344344
j := i
345345
for ; j < len(runes); j++ {
346-
if strings.IndexRune(cutset, runes[j]) >= 0 {
346+
if strings.ContainsRune(cutset, runes[j]) {
347347
break
348348
}
349349
}

0 commit comments

Comments
 (0)
Please sign in to comment.