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
When you call fmt.Printf("%v") on any non-String events.DynamoDBAttributeValue a panic gets embedded into your string.
Example:
package main
import (
"fmt""github.com/aws/aws-lambda-go/events"
)
funcmain() {
v:=events.NewNumberAttribute("5")
fmt.Println("This is a number: %v", v)
}
Outputs:
$ go run bugreport.go
This is a number: %v %!v(PANIC=String method: accessor called for incompatible type, requested type 8 but actual type was 5)
As far as I can tell this is due to the fact that you are using .String() as the function to get back a string from the attribute. This conflicts with the fact that .String() is also the interface used for printing.
When you call
fmt.Printf("%v")
on any non-Stringevents.DynamoDBAttributeValue
a panic gets embedded into your string.Example:
Outputs:
As far as I can tell this is due to the fact that you are using
.String()
as the function to get back a string from the attribute. This conflicts with the fact that.String()
is also the interface used for printing.aws-lambda-go/events/attributevalue.go
Line 94 in ec2fec7
The text was updated successfully, but these errors were encountered: