Skip to content

Commit a20ffa6

Browse files
Middleware fix
1 parent f05dae7 commit a20ffa6

File tree

1 file changed

+23
-1
lines changed
  • DynamoDbEncryption/runtimes/go/ImplementationFromDafny-go/dbesdkmiddleware

1 file changed

+23
-1
lines changed

DynamoDbEncryption/runtimes/go/ImplementationFromDafny-go/dbesdkmiddleware/utils.go

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,9 +665,31 @@ func deepCopyTransactGetItem(item types.TransactGetItem) types.TransactGetItem {
665665
func deepCopyGet(get *types.Get) *types.Get {
666666
// Deep copy the Key map in Get
667667
copyKey := deepCopyAttributeMap(get.Key)
668+
// Copy string pointers
669+
var tableName *string
670+
if get.TableName != nil {
671+
t := *get.TableName
672+
tableName = &t
673+
}
674+
// Deep copy ExpressionAttributeNames map
675+
if get.ExpressionAttributeNames != nil {
676+
copyExpressionAttributeNames := make(map[string]string, len(get.ExpressionAttributeNames))
677+
for k, v := range get.ExpressionAttributeNames {
678+
copyExpressionAttributeNames[k] = v
679+
}
680+
}
681+
682+
var ProjectionExpression *string
683+
if get.ProjectionExpression != nil {
684+
t := *get.ProjectionExpression
685+
ProjectionExpression = &t
686+
}
668687

669688
return &types.Get{
670-
Key: copyKey,
689+
Key: copyKey,
690+
TableName: tableName,
691+
ExpressionAttributeNames: deepCopyStringMap(get.ExpressionAttributeNames),
692+
ProjectionExpression: ProjectionExpression,
671693
}
672694
}
673695

0 commit comments

Comments
 (0)