Skip to content

Add WithSelectedDescriptors API #371

@tri-adam

Description

@tri-adam

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions