fix formatting

This commit is contained in:
Chris Lu 2020-09-02 21:42:12 -07:00
parent 0d99a5da3c
commit 68e878adb5
2 changed files with 3 additions and 3 deletions

View file

@ -128,7 +128,7 @@ func (store *MongodbStore) FindEntry(ctx context.Context, fullpath util.FullPath
var where = bson.M{"directory": dir, "name": name}
err = store.connect.Database(store.database).Collection(store.collectionName).FindOne(ctx, where).Decode(&data)
if err != mongo.ErrNoDocuments && err != nil {
glog.Error("find %s: %v", fullpath, err)
glog.Errorf("find %s: %v", fullpath, err)
return nil, filer_pb.ErrNotFound
}

View file

@ -36,7 +36,7 @@ func (store *MongodbStore) KvGet(ctx context.Context, key []byte) (value []byte,
var where = bson.M{"directory": dir, "name": name}
err = store.connect.Database(store.database).Collection(store.collectionName).FindOne(ctx, where).Decode(&data)
if err != mongo.ErrNoDocuments && err != nil {
glog.Error("kv get: %v", err)
glog.Errorf("kv get: %v", err)
return nil, filer.ErrKvNotFound
}
@ -54,7 +54,7 @@ func (store *MongodbStore) KvDelete(ctx context.Context, key []byte) (err error)
where := bson.M{"directory": dir, "name": name}
_, err = store.connect.Database(store.database).Collection(store.collectionName).DeleteOne(ctx, where)
if err != nil {
return fmt.Errorf("kv delete %s : %v", err)
return fmt.Errorf("kv delete: %v", err)
}
return nil