(w io.Writer, items []T)
| 237 | } |
| 238 | |
| 239 | func writeJSONL[T any](w io.Writer, items []T) error { |
| 240 | enc := json.NewEncoder(w) |
| 241 | for _, item := range items { |
| 242 | if err := enc.Encode(item); err != nil { |
| 243 | return err |
| 244 | } |
| 245 | } |
| 246 | return nil |
| 247 | } |
| 248 | |
| 249 | // readJSONL reads a file of JSON objects, one per line. A missing file has |
| 250 | // none. |
no outgoing calls
no test coverage detected