Skip to content

Commit

Permalink
Fix minor lint issue and documentation phrasing
Browse files Browse the repository at this point in the history
Change-Id: I05fac1907eda43b12f90d44560aebc0df247be7a
  • Loading branch information
skriptble committed Apr 19, 2018
1 parent dfb3339 commit 01bdd07
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions mongo/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ func (coll *Collection) Indexes() IndexView {
return IndexView{coll: coll}
}

// Drop function drops the collection from db.
// Drop drops this collection from database.
func (coll *Collection) Drop(ctx context.Context) error {
if ctx == nil {
ctx = context.Background()
Expand All @@ -711,12 +711,8 @@ func (coll *Collection) Drop(ctx context.Context) error {
Collection: coll.name,
}
_, err := dispatch.DropCollection(ctx, cmd, coll.client.topology, coll.writeSelector)
if err != nil {
if command.IsNotFound(err) {
return nil
} else {
return err
}
if err != nil && !command.IsNotFound(err) {
return err
}
return nil
}

0 comments on commit 01bdd07

Please sign in to comment.