File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,15 @@ func (av DynamoDBAttributeValue) Number() string {
68
68
return av .value .(string )
69
69
}
70
70
71
+ // Int64 provides access to an attribute of type Number.
72
+ // DynamoDB sends the values as strings. For convenience this method
73
+ // provides conversion to int.
74
+ // Method panics if the attribute is not of type Number.
75
+ func (av DynamoDBAttributeValue ) Int64 () (int64 , error ) {
76
+ number := av .Number ()
77
+ return strconv .ParseInt (number , 10 , 64 )
78
+ }
79
+
71
80
// Integer provides access to an attribute of type Number.
72
81
// DynamoDB sends the values as strings. For convenience this method
73
82
// provides conversion to int. If the value cannot be represented by
@@ -76,7 +85,7 @@ func (av DynamoDBAttributeValue) Number() string {
76
85
// Method panics if the attribute is not of type Number.
77
86
func (av DynamoDBAttributeValue ) Integer () (int64 , error ) {
78
87
number := av .Number ()
79
- value , err := strconv . ParseInt ( number , 10 , 64 )
88
+ value , err := av . Int64 ( )
80
89
if err == nil {
81
90
return value , nil
82
91
}
You can’t perform that action at this time.
0 commit comments