Add check for event extensions sending
@@ -141,6 +141,7 @@ func main() {
event.SetType(eventType)
event.SetSource(eventSource)
+ if eventExtensions != "" {
var extensions map[string]interface{}
if err := json.Unmarshal([]byte(eventExtensions), &extensions); err != nil {
log.Fatalf("Encountered error when unmarshalling cloud event extensions to map[string]interface{}: %v", err)
@@ -148,6 +149,7 @@ func main() {
for k, v := range extensions {
event.SetExtension(k, v)
}
+ }
if err := event.SetData(untyped); err != nil {
log.Fatalf("failed to set data, %v", err)
