MCPcopy
hub / github.com/aceld/zinx / close

Method close

zutils/witer.go:208–218  ·  view source on GitHub ↗

close closes the file if it is open.

()

Source from the content-addressed store, hash-verified

206
207// close closes the file if it is open.
208func (w *Writer) close() error {
209 w.mu.Lock()
210 defer w.mu.Unlock()
211 if w.file == nil {
212 return nil
213 }
214 w.file.Sync()
215 err := w.file.Close()
216 w.file = nil
217 return err
218}
219
220func (w *Writer) flush() error {
221 w.mu.Lock()

Callers 1

CloseMethod · 0.95

Calls 1

CloseMethod · 0.80

Tested by

no test coverage detected