5MB
(filename string, stdin io.ReadCloser)
| 9 | const maxCapacity = 1024 * 5120 // 5MB |
| 10 | |
| 11 | func ReadFile(filename string, stdin io.ReadCloser) ([]byte, error) { |
| 12 | if filename == "-" { |
| 13 | b, err := io.ReadAll(stdin) |
| 14 | _ = stdin.Close() |
| 15 | return b, err |
| 16 | } |
| 17 | |
| 18 | return os.ReadFile(filename) |
| 19 | } |
| 20 | |
| 21 | func ScanFile(filename string, stdin io.ReadCloser) (*bufio.Scanner, error) { |
| 22 | var scanner *bufio.Scanner |
no test coverage detected