()
| 294 | } |
| 295 | |
| 296 | func (o *FileOutput) closeLocked() error { |
| 297 | if o.file != nil { |
| 298 | if strings.HasSuffix(o.currentName, ".gz") { |
| 299 | o.writer.(*gzip.Writer).Close() |
| 300 | } else { |
| 301 | o.writer.(*bufio.Writer).Flush() |
| 302 | } |
| 303 | o.file.Close() |
| 304 | |
| 305 | if o.config.onClose != nil { |
| 306 | o.config.onClose(o.file.Name()) |
| 307 | } |
| 308 | } |
| 309 | |
| 310 | o.closed = true |
| 311 | o.currentFileSize = 0 |
| 312 | |
| 313 | return nil |
| 314 | } |
| 315 | |
| 316 | // Close closes the output file that is being written to. |
| 317 | func (o *FileOutput) Close() error { |
no test coverage detected