prettier checkpoint close

This commit is contained in:
vyzo 2022-01-30 15:00:03 +02:00
parent 64cda4aeda
commit 72333147d3

View File

@ -66,12 +66,15 @@ func (cp *Checkpoint) Set(c cid.Cid) error {
return nil
}
func (cp *Checkpoint) Close() (err error) {
if cp.file != nil {
err = cp.file.Close()
cp.file = nil
cp.buf = nil
func (cp *Checkpoint) Close() error {
if cp.file == nil {
return nil
}
err := cp.file.Close()
cp.file = nil
cp.buf = nil
return err
}