Started writing documentation and adding examples
This commit is contained in:
parent
7adb09d4db
commit
405bf812ee
5 changed files with 40 additions and 0 deletions
3
json.go
3
json.go
|
|
@ -5,6 +5,9 @@ import (
|
|||
"io"
|
||||
)
|
||||
|
||||
// ToJSON is a filter function which converts each line from the source to a JSON structure.
|
||||
// The result is a line-terminated list of JSON objects.
|
||||
// The passed in function is to return a Go value that can be marshalled to JSON value.
|
||||
func ToJSON(fn func(line string) any) func(r io.Reader, w io.Writer) error {
|
||||
return func(r io.Reader, w io.Writer) error {
|
||||
return eachLine(r, func(line string) (err error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue