[]byte, payload interface{}) (Event, error) { var decoded Event err := json.Unmarshal(message, &decoded) if err != nil { return Event{}, nil } if err := decoded.decodePayload(payload); err != nil { return Event{}, nil } return decoded, nil } func (e *Event) decodePayload(i interface{}) error { return mapstructure.Decode(e.Payload, i) }