Skip to content

Commit

Permalink
Static-check fixes from @lespea #1657, batch 3/n
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Oct 27, 2024
1 parent f04b6d7 commit cb2981c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 19 deletions.
6 changes: 2 additions & 4 deletions pkg/output/file_output_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,13 +399,11 @@ func (handler *FileOutputHandler) Close() (retval error) {
done := false
for !done {
select {
case _ = <-handler.recordErroredChannel:
case <-handler.recordErroredChannel:
done = true
retval = errors.New("exiting due to data error") // details already printed
break
case _ = <-handler.recordDoneChannel:
case <-handler.recordDoneChannel:
done = true
break
}
}
}
Expand Down
7 changes: 2 additions & 5 deletions pkg/stream/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,10 @@ func Stream(
select {
case ierr := <-inputErrorChannel:
retval = ierr
break
case _ = <-dataProcessingErrorChannel:
case <-dataProcessingErrorChannel:
retval = errors.New("exiting due to data error") // details already printed
break
case _ = <-doneWritingChannel:
case <-doneWritingChannel:
done = true
break
}
}

Expand Down
11 changes: 3 additions & 8 deletions pkg/terminals/repl/verbs.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,8 @@ func handleSkipOrProcessN(repl *Repl, n int64, processingNotSkipping bool) {
for i := int64(1); i <= n; i++ {
select {
case recordsAndContexts = <-repl.readerChannel:
break
case err = <-repl.errorChannel:
break
case _ = <-repl.appSignalNotificationChannel: // user typed control-C
break
case <-repl.appSignalNotificationChannel: // user typed control-C
}

if err != nil {
Expand Down Expand Up @@ -505,13 +502,11 @@ func handleSkipOrProcessUntil(repl *Repl, dslString string, processingNotSkippin
doubleBreak := false
select {
case recordsAndContexts = <-repl.readerChannel:
break
case err = <-repl.errorChannel:
break
case _ = <-repl.appSignalNotificationChannel: // user typed control-C
case <-repl.appSignalNotificationChannel: // user typed control-C
doubleBreak = true
break
}

if doubleBreak {
break
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/transformers/seqgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,7 @@ func (tr *TransformerSeqgen) Transform(
case b := <-inputDownstreamDoneChannel:
outputDownstreamDoneChannel <- b
keepGoing = false
break
default:
break
}
if !keepGoing {
break
Expand Down

0 comments on commit cb2981c

Please sign in to comment.