functional/rpcpb: fix os.Remove error in SnapshotPath

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
Gyuho Lee 2018-04-11 16:09:22 -07:00
parent 888b55e91b
commit f56d2c61b2

View File

@ -238,7 +238,7 @@ func (m *Member) WriteHealthKey() error {
// snapshot file on local disk.
func (m *Member) SaveSnapshot(lg *zap.Logger) (err error) {
// remove existing snapshot first
if err = os.Remove(m.SnapshotPath); err != nil {
if err = os.RemoveAll(m.SnapshotPath); err != nil {
return err
}