Open bpeake-illuscio opened 3 years ago
I just updated this PR to also include a GetValueIndex() method. I am working on a problem where it would be useful in testing to be able to build a []interface{} slice of the inner Element values.
Although, looking at this I think it might make more sense to handle PixelData like []byte, always return a count of 1, and return the entire data, instead of frames. I'm going to update that real quick.
alright, that change is up.
Hello again!
In writing some code, I realized it would be useful to get the number of inner values a Value contains without having to do a type assert (or really knowing anything about the inner type).
This is a small PR that adds a
ValueCount()int
andGetValueIndex(i int)interface{}
methods toValue
.Example:
I've opened this as a draft PR in case you feel it doesn't fit the lib. Let me know what you think!