Skip to content

Commit cb0a6aa

Browse files
committed
Base satisfies the document interface
1 parent e508567 commit cb0a6aa

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

mongo/document/base.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ func (d *Base) destroy(ctx context.Context, collection string) error {
4545
return ReallyDestroy(ctx, collection, d)
4646
}
4747

48-
func (d Base) Validate(ctx context.Context) *ValidationErrors {
48+
func (d *Base) Validate(ctx context.Context) *ValidationErrors {
4949
return nil
5050
}

mongo/document/document.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ type Validable interface {
4949
Validate(ctx context.Context) *ValidationErrors
5050
}
5151

52-
var _ Validable = Base{}
52+
var _ Validable = &Base{}
5353

54-
// Create inser the document in the database, returns an error if document already exists and set CreatedAt timestamp
54+
// Create inserts the document in the database, returns an error if document already exists and set
55+
// CreatedAt timestamp
5556
func Create(ctx context.Context, collectionName string, doc document) error {
5657
log := logger.Get(ctx)
5758
doc.ensureID()

0 commit comments

Comments
 (0)