Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

btf: only return exact matches from AnyTypesByName #525

Merged
merged 2 commits into from
Dec 16, 2021
Merged

Conversation

lmb
Copy link
Collaborator

@lmb lmb commented Dec 13, 2021

Change AnyTypesByName so that essential names stay an implementation
detail of the btf package: we need spec.namedTypes for fast
flavour lookup, but it's not clear that we should expose the flavour
name distinction to the users.

Fix this by only returning types which have an exact name match. This
means that AnyTypesByName("ambiguous") does not return ambiguous___flavour.

@lmb lmb requested a review from ti-mo December 13, 2021 11:14
internal/btf/btf_test.go Outdated Show resolved Hide resolved
Change AnyTypesByName so that essential names stay an implementation
detail of the btf package: we need spec.namedTypes for fast
flavour lookup, but it's not clear that we should expose the flavour
name distinction to the users.

Fix this by only returning types which have an exact name match. This
means that `AnyTypesByName("ambiguous")` does not return ambiguous___flavour.
@ti-mo ti-mo merged commit f9c3ad7 into master Dec 16, 2021
@ti-mo ti-mo deleted the lmb/essential-name branch December 16, 2021 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants