sif
sif copied to clipboard
Add `WithSelectedDescriptors` API
We currently expose WithDescriptors which iterates across all descriptors, and GetDescriptors which use a selection function to return one or more descriptors.
It occurs to me that there are cases where a caller might want to iterate across only selected descriptors. Although this can be accomplished via WithDescriptors or GetDescriptors today, it requires extra legwork on the part of the caller.
I believe it would be trivial enough to add a new API for this, something like:
func (f *FileImage) WithSelectedDescriptors(fn func(d Descriptor) bool, fns ...DescriptorSelectorFunc)