// Repair tries to repair ErrUnexpectedEOF in the // last wal file by truncating. func Repair(lg *zap.Logger, dirpath string) bool { … } // openLast opens the last wal file for read and write. func openLast(lg *zap.Logger, dirpath string) (*fileutil.LockedFile, error) { … }