Closed
Description
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"
)
func main() {
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.
aws-lambda-go/events/attributevalue.go
Line 94 in ec2fec7