correctness of ContentTypeJson value
Looks like the following:
eventData := esdb.EventData{
ContentType: esdb.ContentTypeJson,
EventType: "TestEvent",
Data: data,
}
in https://github.com/EventStore/EventStore-Client-Go/blob/c29aa7d3ce9c0aadc7d2bfa3dd060f2865efb227/samples/quickstart.go#L42C21-L42C36 is incorrect , does it have to be int as in below?
https://github.com/EventStore/EventStore-Client-Go/blob/c29aa7d3ce9c0aadc7d2bfa3dd060f2865efb227/esdb/event_data.go#L12
the following code works for me:
eventData := esdb.EventData {
ContentType: 1,
EventType: "TestEvent",
Data: data,
}
So, the ContentType: esdb.ContentTypeJson need to be changed to ContentType: 1 ?
Hey @karthiksedoc,
I'm a bit confused by your question. See esdb.ContentTypeJson is a regular integer as shown at its declaration site.
https://github.com/EventStore/EventStore-Client-Go/blob/v4.2.0/esdb/event_data.go
So it is normal to be able to use either 1 or esdb.ContentTypeJson.
Hey @karthiksedoc,
I'm a bit confused by your question. See
esdb.ContentTypeJsonis a regular integer as shown at its declaration site.https://github.com/EventStore/EventStore-Client-Go/blob/v4.2.0/esdb/event_data.go
So it is normal to be able to use either
1oresdb.ContentTypeJson.
Thanks for getting back to me @YoEight 👍 . I might be not setting it properly:
When I set:
eventData := esdb.EventData {
ContentType: esdb.ContentTypeJson,
EventType: "TestEvent",
Data: data,
}
I get the follow:
➜ gorpc_test git:(main) go build main.go
# command-line-arguments
./main.go:42:21: undefined: esdb.ContentTypeJson
the build works without error when setting:
eventData := esdb.EventData {
ContentType: 1,
EventType: "TestEvent",
Data: data,
}
I was following the example and encountered this 🙇