(tempFile *os.File)
| 318 | } |
| 319 | |
| 320 | func getFileSize(tempFile *os.File) (int64, error) { |
| 321 | // Known reasons stat could fail here: |
| 322 | // 1. temp file was removed by an external process |
| 323 | // 2. filesystem is no longer available |
| 324 | |
| 325 | stat, err := os.Stat(tempFile.Name()) |
| 326 | if err != nil { |
| 327 | return 0, err |
| 328 | } |
| 329 | return stat.Size(), nil |
| 330 | } |
| 331 | |
| 332 | func gatherOutput(tempFile *os.File, truncateForPingOutput bool) []byte { |
| 333 | var outputBytes []byte |
no outgoing calls
no test coverage detected