Skip to content

Commit 43bf06d

Browse files
committed
chore: transact items to be a variadic function
1 parent bbd199d commit 43bf06d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/transact_items_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func TestTransactItems(t *testing.T) {
102102
}
103103
//perform operations
104104
if len(tc.operations) > 0 {
105-
err := table.TransactItems(ctx, tc.operations)
105+
err := table.TransactItems(ctx, tc.operations...)
106106
if err != nil {
107107
t.Fatalf("error occurred %s", err)
108108
}

transaction_items.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func (t *Client) WithPutItem(pk string, sk string, item interface{}) types.Trans
4646

4747
// TransactItems is a synchronous for writing or deletion operation performed in dynamodb grouped together
4848

49-
func (t *Client) TransactItems(ctx context.Context, input []types.TransactWriteItem) error {
49+
func (t *Client) TransactItems(ctx context.Context, input ...types.TransactWriteItem) error {
5050
_, err := t.client.TransactWriteItems(ctx, &dynamodb.TransactWriteItemsInput{
5151
TransactItems: input,
5252
})

0 commit comments

Comments
 (0)