Closed Jacalz closed 1 year ago
Test failure does not seem to be a fault of this PR. Tests are passing locally for me.
I rewrote the code to only use one type cast and make everything more readable over all.
Refect isn't magic. Its a fairly normal pattern in the stdlib (e.g. encoding/json
encoding/xml
). I don't consider the additional code to be better.
Yes it isn't magic but it also should be used very sparingly. I agree to disagree.
This implements the message collection in the
waitFor
method without using thereflect
package. We can use a type switch and copy over the field values directly and also make sure that non-pointer values or unsupported collector types return an error.This implementation uses a bit less "magic" and is more understandable in my opinion.
Supersedes #94