MCPcopy
hub / github.com/probelabs/goreplay / closeLocked

Method closeLocked

output_file.go:296–314  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

294}
295
296func (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.
317func (o *FileOutput) Close() error {

Callers 2

PluginWriteMethod · 0.95
CloseMethod · 0.95

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected