You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which panics with panic: accessor called for incompatible type, requested type 5 but actual type was 1.
Suggestions
Either of:
Preferred: The method should panic if the attribute is not of type String, which is consistent with the documented behavior as well as the behavior of the other accessor methods.
Update the documentation so that it correctly reflects the behavior of the method.
Additional information
Observed when using github.com/aws/aws-lambda-go v1.41.0
Go 1.20
The text was updated successfully, but these errors were encountered:
TylerHendrickson
changed the title
DynamoDBAttributeValue accessor methods inconsistent with documented behavior
DynamoDBAttributeValue.String() accessor method inconsistent with documented behavior
Jul 1, 2023
Problem
The documented behavior for the
DynamoDBAttributeValue.String()
method, similar to the other accessor methods, states:However, this does not appear to be the case.
Example
Using this code:
does not panic, but outputs
Result: {true 1}
.This is unlike the other accessor methods, such as
.Number()
, e.g.:which panics with
panic: accessor called for incompatible type, requested type 5 but actual type was 1
.Suggestions
Either of:
Additional information
github.com/aws/aws-lambda-go v1.41.0
1.20
The text was updated successfully, but these errors were encountered: