Skip to content

Commit

Permalink
fix: interface type mismatch for TransactItems (#13)
Browse files Browse the repository at this point in the history
PR #6 caused an interface - implementation type mismatch for
TransactItems function.
This PR fixes the type issue(Interface needs to be corrected), and adds
a small test to prevent future occurrences of this kind of scenario.
  • Loading branch information
shidil authored Jan 23, 2024
2 parents 1d836bb + aaea352 commit 6e22d4e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions client_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package dynago_test

import (
"testing"

"github.com/oolio-group/dynago"
)

func TestClient(t *testing.T) {
// test if dynago.Client implements dynago.DynamoClient interface
var client dynago.DynamoClient = &dynago.Client{}
_, ok := client.(*dynago.Client)
if !ok {
t.Errorf("client does not implement DynamoClient interface")
}
}
2 changes: 1 addition & 1 deletion interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type WriteAPI interface {

type TransactionAPI interface {
TransactPutItems(ctx context.Context, items []*TransactPutItemsInput) error
TransactItems(ctx context.Context, input []types.TransactWriteItem) error
TransactItems(ctx context.Context, input ...types.TransactWriteItem) error
}

type ReadAPI interface {
Expand Down

0 comments on commit 6e22d4e

Please sign in to comment.