Static-check fixes from @lespea #1657, batch 3/n (#1705)

* Static-check fixes from @lespea #1657, batch 2/n

* Static-check fixes from @lespea #1657, batch 3/n
This commit is contained in:
John Kerl 2024-10-27 11:55:38 -04:00 committed by GitHub
parent cc8a3c4b4e
commit 04a9b9decd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 19 deletions

View file

@ -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
}
}
}

View file

@ -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
}
}

View file

@ -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 {
@ -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
}

View file

@ -192,9 +192,7 @@ func (tr *TransformerSeqgen) Transform(
case b := <-inputDownstreamDoneChannel:
outputDownstreamDoneChannel <- b
keepGoing = false
break
default:
break
}
if !keepGoing {
break