Fix print within begin{}/end{} (#1795)

* codemod per se

* unit-test coverage

* lint
This commit is contained in:
John Kerl 2025-05-01 17:18:17 -04:00 committed by GitHub
parent 100166532c
commit 34bc8a1c3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 1 deletions

View file

@ -70,8 +70,9 @@ func channelWriterHandleBatch(
// XXX more
// XXX also make sure this results in exit 1 & goroutine cleanup
if writerOptions.FailOnDataError {
if writerOptions.FailOnDataError && record != nil {
ok := true
fmt.Printf("AAA %#v", record)
for pe := record.Head; pe != nil; pe = pe.Next {
if pe.Value.IsError() {
context := recordAndContext.Context

View file

@ -0,0 +1 @@
mlr --from test/input/s.dkvp put -q 'begin{print 8}; end{print 9}'

View file

View file

@ -0,0 +1,2 @@
8
9