Skip to content

Commit

Permalink
Make DynamoDB methods receive *DynamoDB
Browse files Browse the repository at this point in the history
Since a single DynamoDB instance will be passed around via pointer, the
methods need to receive a pointer. This eliminates unnecessary copying,
and is required for *DynamoDB to match the Database interface anyway.
  • Loading branch information
mbland committed Apr 14, 2023
1 parent 91b47d0 commit e168c85
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions db/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ func NewDynamoDb(awsConfig aws.Config, tableName string) *DynamoDb {
}
}

func (db DynamoDb) Get(email string) (*Subscriber, error) {
func (db *DynamoDb) Get(email string) (*Subscriber, error) {
return nil, nil
}

func (db DynamoDb) Put(record *Subscriber) error {
func (db *DynamoDb) Put(record *Subscriber) error {
return nil
}

func (db DynamoDb) Delete(email string) error {
func (db *DynamoDb) Delete(email string) error {
return nil
}

0 comments on commit e168c85

Please sign in to comment.