Closed gotama closed 4 months ago
Hi @gotama,
Dividing values in half is an expected behavior of AsStrMap because it assumes the values should be a RESP map.
For your manager.Client.B().Keys().Pattern("*").Build()
use case, you should use .AsStrSlice() instead.
Hi @rueian
Thank you so much for the advice, sorry for wasting your time I should of spent more time looking into message.go
your help has moved me forward.
I have this function to Do commands and im trying to get an array of values from it using this code :
When calling AsStrMap it halves the size of the return so im only getting one value instead of two.
From the
manager.Client.B().Keys().Pattern("*").Build()
command this data was used.However I am only getting half the array so only on value instead of two. Is this intended behavior?
This code gives me the values i expect:
Maybe I should not be using
msg, err := resp.ToMessage()
because the way the key value map[string]string gets created in the for loop im setting key and value to be the same which is probably not the best use of a key value map.Maybe any experts could comment on my code and also offer some guidance on how to get the best use case out of AsStrMap