mirror of
https://github.com/mikefarah/yq.git
synced 2025-01-26 08:25:38 +00:00
Report while filename failed to parse #1030
This commit is contained in:
parent
c17cf82791
commit
ffd1f022aa
@ -244,7 +244,7 @@ Next, we convert the map back to an array, using reduce again, concatenating all
|
||||
|
||||
Finally, we set the result of the merged array back into the first doc.
|
||||
|
||||
To use this, you will need to update '.myArray' to be the expression to your array (e.g. .my.array), and '.a' to be the key field of your array (e.g. '.name')
|
||||
To use this, you will need to update '.myArray' in the expression to your array (e.g. .my.array), and '.a' to be the key field of your array (e.g. '.name')
|
||||
|
||||
Thanks Kev from [stackoverflow](https://stackoverflow.com/a/70109529/1168223)
|
||||
|
||||
|
@ -3,6 +3,7 @@ package yqlib
|
||||
import (
|
||||
"container/list"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
@ -100,7 +101,7 @@ func (s *streamEvaluator) Evaluate(filename string, reader io.Reader, node *Expr
|
||||
s.fileIndex = s.fileIndex + 1
|
||||
return currentIndex, nil
|
||||
} else if errorReading != nil {
|
||||
return currentIndex, errorReading
|
||||
return currentIndex, fmt.Errorf("bad file '%v': %w", filename, errorReading)
|
||||
}
|
||||
|
||||
candidateNode := &CandidateNode{
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"bufio"
|
||||
"container/list"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"regexp"
|
||||
@ -122,7 +123,7 @@ func readDocuments(reader io.Reader, filename string, fileIndex int) (*list.List
|
||||
}
|
||||
return inputList, nil
|
||||
} else if errorReading != nil {
|
||||
return nil, errorReading
|
||||
return nil, fmt.Errorf("bad file '%v': %w", filename, errorReading)
|
||||
}
|
||||
candidateNode := &CandidateNode{
|
||||
Document: currentIndex,
|
||||
|
Loading…
Reference in New Issue
Block a user