Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code linting #1500

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions ginkgo/command/program.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ func (p Program) RunAndExit(osArgs []string) {
fmt.Fprintln(p.ErrWriter, deprecationTracker.DeprecationsReport())
}
p.Exiter(exitCode)
return
}()

args, additionalArgs := []string{}, []string{}
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion ginkgo/internal/gocovmerge.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion ginkgo/run/run_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion internal/internal_integration/progress_report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions internal/parallel_support/http_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion types/label_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
Loading