ParseReader parses the data from r using filename as information in the error messages.
(filename string, r io.Reader, opts ...Option)
| 24530 | // ParseReader parses the data from r using filename as information in the |
| 24531 | // error messages. |
| 24532 | func ParseReader(filename string, r io.Reader, opts ...Option) (any, error) { |
| 24533 | b, err := io.ReadAll(r) |
| 24534 | if err != nil { |
| 24535 | return nil, err |
| 24536 | } |
| 24537 | |
| 24538 | return Parse(filename, b, opts...) |
| 24539 | } |
| 24540 | |
| 24541 | // Parse parses the data from b using filename as information in the |
| 24542 | // error messages. |