(filename string, stdin io.ReadCloser)
| 7 | ) |
| 8 | |
| 9 | func ReadFile(filename string, stdin io.ReadCloser) ([]byte, error) { |
| 10 | if filename == "-" { |
| 11 | b, err := io.ReadAll(stdin) |
| 12 | _ = stdin.Close() |
| 13 | return b, err |
| 14 | } |
| 15 | |
| 16 | return os.ReadFile(filename) |
| 17 | } |
| 18 | |
| 19 | // ReadMarkdownBodyFile reads Markdown from path and returns its base directory |
| 20 | // for resolving local attachment references. Standard input has no base |
no test coverage detected