aerospike / aerospike-client-go

Aerospike Client Go
Apache License 2.0
430 stars 199 forks source link

How to use aerospike.GetObject with a [][]byte value #424

Closed ajeetdsouza closed 2 months ago

ajeetdsouza commented 5 months ago

I have a list of bytestrings in a bin that I'd like to fetch from Aerospike:

type Event {
  ID string `as:"id"`
  Payloads [][]byte `as:"payloads"`
}

However, when doing a GetObject operation using this struct, aerospike-client-go treats this as a list of bytes rather than a bytestring:

Invalid value `<VALUE>`  for slice field

I could work around it by using a []string, but since these are arbitrary bytes and not UTF-8 strings, it seems to be a suboptimal approach. How can I do this correctly?

khaf commented 3 months ago

Sorry for the late reply. I can't repro this issue on the latest Go client. Which version of the client are you using? Can you provide a gist that reproduces the issue?

khaf commented 2 months ago

Closing the issue due to inactivity. Feel free to file new issues or reopen the ticket for further assistance.